This repository has been archived by the owner on Jan 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (70 loc) · 2.67 KB
/
initialize-deployment.yml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Inititalize kubernetes deployment
on:
workflow_dispatch:
inputs:
cluster:
description: "The cluster to deploy to (implement me)"
required: true
default: 'plus'
type: choice
options:
- 'fits'
- 'plus'
namespace:
description: "The namespace to deploy to"
required: true
default: 'impfen-dev'
type: string
config:
description: "Name of the values yaml file"
required: true
default: "values-plus.yaml"
type: choice
options:
- 'values-plus.yaml'
- 'values-test.yaml'
- 'values-demo.yaml'
concurrency:
group: initialize-deployment
cancel-in-progress: true
jobs:
run-tests:
runs-on: ubuntu-latest
env:
KUBE_CONFIG: ${{ secrets.KUBECONFIG_PLUSCLOUD }}
KUBECONFIG: /home/runner/work/kubernetes/kubernetes/kubeconfig.yml
NAMESPACE: ${{ github.event.inputs.namespace }}
steps:
- uses: actions/checkout@v2
- shell: bash
run: |
echo "$KUBE_CONFIG" | base64 -d > kubeconfig.yml
kubectl delete namespace $NAMESPACE || true
kubectl create namespace $NAMESPACE
kubectl config set-context --current --namespace=$NAMESPACE
kubectl version --client
helm version
echo Install secret
(
cd settings/dev
kubectl create secret generic kiebitz-dev \
--from-file=001_default.yml \
--from-file=002_admin.json \
--from-file=003_appt.json \
--from-file=004_storage.json \
--from-file=secret-mediator-keys
)
helm repo add dandydev https://dandydeveloper.github.io/charts
helm install --namespace $NAMESPACE --set haproxy.enabled=true db dandydev/redis-ha
cat <<EOF
waiting for Redis pods to become ready
EOF
kubectl wait -l statefulset.kubernetes.io/pod-name=db-redis-ha-server-0 --for=condition=ready pod --timeout=-1s
helm install kiebitz-plus -f ./charts/kiebitz/${{ github.event.inputs.config }} ./charts/kiebitz
cat <<EOF
waiting for deployments getting available
EOF
kubectl wait --for=condition=available --timeout=60s deployment/kiebitz-plus-static
kubectl wait --for=condition=available --timeout=60s deployment/kiebitz-plus-kiebitz
kubectl exec `kubectl get pod -l app.kubernetes.io/name=kiebitz -o jsonpath='{.items[0].metadata.name}'` /kiebitz admin mediators upload /settings/secret-mediator-keys
kubectl exec db-redis-ha-server-0 -c redis -- redis-cli -c -h db-redis-ha-haproxy keys '*'