-
Notifications
You must be signed in to change notification settings - Fork 3
76 lines (74 loc) · 2.54 KB
/
end2end.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
# This workflow installs 2 instances of canary-bot and
# verify the API output
name: End2End Testing
on:
push:
jobs:
end2end:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set up K3S
uses: debianmaster/actions-k3s@master
id: k3s
with:
version: 'v1.24.8-k3s1'
- name: Check Cluster
run: |
kubectl get nodes
- name: Setup Helm
run: |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
helm version
- name: Install Canary 00
run: |
helm upgrade -i canary-00 \
--atomic \
--timeout 300s \
--set mesh.MESH_NAME=canary-00 \
--set mesh.MESH_JOIN_ADDRESS=canary-00-canary-bot-mesh:8081 \
--set mesh.MESH_TARGET=canary-01-canary-bot-mesh:8081 \
--set addEnv.MESH_TOKEN=12345678 chart
- name: Install Canary 01
run: |
helm upgrade -i canary-01 \
--atomic \
--timeout 300s \
--set mesh.MESH_NAME=canary-01 \
--set mesh.MESH_JOIN_ADDRESS=canary-01-canary-bot-mesh:8081 \
--set mesh.MESH_TARGET=canary-00-canary-bot-mesh:8081 \
--set addEnv.MESH_TOKEN=12345678 chart
- name: Check Pods
run: |
kubectl get pods
- name: Check Canary 00
run: |
kubectl create job curl --image=mtr.devops.telekom.de/mcsps/curl:7.65.3 -- curl -f -v -H 'Authorization: Bearer 12345678' -H 'Content-Type: application/json' http://canary-00-canary-bot-api:8080/api/v1/samples
kubectl wait --for=condition=complete job/curl
STATUS=$(kubectl get job curl -o jsonpath={.status.succeeded})
if [[ $STATUS -ne 1 ]]
then
echo "Job failed"
kubectl logs -ljob-name=curl
kubectl delete job curl
exit 1
else
echo "Job OK"
kubectl delete job curl
fi
- name: Check Canary 01
run: |
kubectl create job curl --image=mtr.devops.telekom.de/mcsps/curl:7.65.3 -- curl -f -v -H 'Authorization: Bearer 12345678' -H 'Content-Type: application/json' http://canary-01-canary-bot-api:8080/api/v1/samples
kubectl wait --for=condition=complete job/curl
STATUS=$(kubectl get job curl -o jsonpath={.status.succeeded})
if [[ $STATUS -ne 1 ]]
then
echo "Job failed"
kubectl logs -ljob-name=curl
kubectl delete job curl
exit 1
else
echo "Job OK"
kubectl delete job curl
fi