forked from eddycharly/kind-playground
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitea.sh
executable file
·68 lines (55 loc) · 1.28 KB
/
gitea.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env bash
set -e
# CONSTANTS
readonly DNSMASQ_DOMAIN=kind.cluster
# FUNCTIONS
log(){
echo "---------------------------------------------------------------------------------------"
echo $1
echo "---------------------------------------------------------------------------------------"
}
gitea(){
log "GITEA ..."
helm upgrade --install --wait --timeout 15m --atomic --namespace gitea --create-namespace \
--repo https://dl.gitea.io/charts gitea gitea --values - <<EOF
gitea:
admin:
username: gitea_admin
password: admin
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: ca-issuer
nginx.ingress.kubernetes.io/ssl-redirect: 'false'
hosts:
- host: gitea.$DNSMASQ_DOMAIN
paths:
- path: /
pathType: Prefix
tls:
- secretName: gitea.$DNSMASQ_DOMAIN
hosts:
- gitea.$DNSMASQ_DOMAIN
EOF
}
repository(){
local NAME=${1:-gitops}
curl -X POST \
-u gitea_admin:admin \
https://gitea.kind.cluster/api/v1/user/repos \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d @- <<EOF
{
"name": "$NAME"
}
EOF
}
# RUN
gitea
sleep 10s
repository gitops
# DONE
log "GITEA READY !"
echo "GITEA: https://gitea.$DNSMASQ_DOMAIN"