-
Notifications
You must be signed in to change notification settings - Fork 19
101 lines (84 loc) · 2.9 KB
/
deploy.yaml
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Deploy to the demo namespace
on:
push:
branches:
- 'main'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v1
- name: Authenticate and set context
uses: redhat-actions/oc-login@v1
with:
# URL to your OpenShift cluster.
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_FIWARE }}
# Authentication Token. Can use username and password instead.
openshift_token: ${{ secrets.OPENSHIFT_TOKEN_FIWARE }}
# Disables SSL cert checking. Use this if you don't have the certificate authority data.
insecure_skip_tls_verify: true
- name: Deploy applications
run: |
cd fiware-platform/
# render app of apps and apply it
helm template ${{ secrets.OVERWRITE_VALUES }} . | oc -n argocd apply -f -
- name: Check if all apps are healthy
run: |
# wait for the changes to take place and potentially crash the applications
sleep 30
# bool to check if the apps are healthy
healthy=0
# counter to set a number of tries
try=0
tries=30
# get the list of apps in the namespace
componentsInstalled=$(grep "enabled: true" fiware-platform/values.yaml -c)
# check if the condition is met
while [ $healthy == 0 ] && [ $try -lt $tries ]
do
apps=$(oc get applications.argoproj.io --no-headers -n argocd -l destination-namespace=demo | awk '{ print $3 }')
healthyapps=0
for app in $apps
do
if [ $app != "Healthy" ]
then
echo "Trying again in 10 seconds"
sleep 10
try=$(( try + 1 ))
break
elif [ $app == "Healthy" ]
then
healthyapps=$(( healthyapps + 1 ))
fi
if [ $healthyapps == $componentsInstalled ]
then
healthy=1
fi
done
done
if [ $try -eq $tries ]
then
echo "ERROR: Tried too many times"
exit 1
fi
- name: Deploy the helm charts for the e2e
run: |
# go to selenium-grid directory
cd tests/selenium-grid
# install selenium-grid
helm install --wait selenium . -n demo
# go to the e2e-test directory
cd ../e2e-test
# install the helm chart
helm install e2e . -n demo
- name: Uninstall marinera-e2e helm chart
if: always()
run: |
# uninstall the e2e helm chart
helm uninstall e2e -n demo
- name: Uninstall selenium-grid helm chart
if: always()
run: |
# uninstall the selenium-grid helm chart
helm uninstall selenium -n demo