forked from ksctl/ksctl
-
Notifications
You must be signed in to change notification settings - Fork 0
170 lines (133 loc) · 5.07 KB
/
e2e-civo.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: e2e for civo
on:
workflow_dispatch:
workflow_call:
jobs:
execute-civo:
environment: e2e
runs-on: e2e
env:
E2E_FLAGS: debug
KUBECONFIG: ${{ vars.KUBECONFIG_KSCTL_LOC }}
PS4: '+\[\033[0;33m\](\[\033[0;36m\]${BASH_SOURCE##*/}:${LINENO}\[\033[0;33m\])\[\033[0m\] '
CIVO_TOKEN: ${{ secrets.CIVO_TOKEN }}
defaults:
run:
working-directory: test/e2e
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
paths:
- 'internal/cloudproviders/civo/*'
- 'internal/k8sdistros/k3s/*'
- 'internal/k8sdistros/kubeadm/*'
- 'internal/k8sdistros/*'
- 'internal/storage/**'
- 'pkg/helpers/**'
- 'test/gh-runner/**'
- 'pkg/logger/**'
- 'test/e2e/*'
- 'test/e2e/civo/*'
- 'go.mod'
- 'go.sum'
- 'pkg/controllers/**'
- 'pkg/resources/**'
- '.github/workflows/e2e-civo.yml'
- name: create (managed)
if: steps.changes.outputs.paths == 'true'
run: |
set -xe
ksctl-e2e-amd64 -op create -file civo/create.json
ksctl-e2e-amd64 -op info -file civo/info.json
- name: create (k3s ha)
if: steps.changes.outputs.paths == 'true'
run: |
set -xe
ksctl-e2e-amd64 -op create -file civo/create-ha.json
ksctl-e2e-amd64 -op info -file civo/info-ha.json
- name: create (kubeadm ha)
if: steps.changes.outputs.paths == 'true'
run: |
set -xe
ksctl-e2e-amd64 -op create -file civo/create-ha-kubeadm.json
ksctl-e2e-amd64 -op info -file civo/info-ha-kubeadm.json
- name: get
if: steps.changes.outputs.paths == 'true'
run: |
set -xe
ksctl-e2e-amd64 -op get -file civo/get.json
- name: switch
if: steps.changes.outputs.paths == 'true'
run: |
echo -e "\033[1;34m@@@\033[0m \033[1;35mManaged Cluster\033[0m \033[1;34m@@@\033[0m"
ksctl-e2e-amd64 -op switch -file civo/switch.json
tree ~/.ksctl/state
jq -r . ~/.ksctl/state/civo/managed/test-e2e-civo\ LON1/state.json
sleep 5s
kubectl get nodes -owide
echo -e "\033[1;34m@@@\033[0m \033[1;35mHA Cluster (K3s)\033[0m \033[1;34m@@@\033[0m"
ksctl-e2e-amd64 -op switch -file civo/switch-ha.json
tree ~/.ksctl/state
jq -r . ~/.ksctl/state/civo/ha/test-e2e-ha-civo\ FRA1/state.json
sleep 5s
kubectl get nodes -owide
echo -e "\033[1;34m@@@\033[0m \033[1;35mHA Cluster (kubeadm)\033[0m \033[1;34m@@@\033[0m"
ksctl-e2e-amd64 -op switch -file civo/switch-ha-kubeadm.json
tree ~/.ksctl/state
jq -r . ~/.ksctl/state/civo/ha/test-e2e-kubeadm-ha-civo\ PHX1/state.json
sleep 5s
kubectl get nodes -owide
- name: scaledown kubeadm
if: steps.changes.outputs.paths == 'true'
run: |
set -xe
ksctl-e2e-amd64 -op switch -file civo/switch-ha-kubeadm.json
sleep 30s
ksctl-e2e-amd64 -op scaledown -file civo/scaledown-ha-kubeadm.json
kubectl get nodes -owide
jq -r . ~/.ksctl/state/civo/ha/test-e2e-kubeadm-ha-civo\ PHX1/state.json
- name: scaleup kubeadm
if: steps.changes.outputs.paths == 'true'
run: |
set -xe
ksctl-e2e-amd64 -op switch -file civo/switch-ha-kubeadm.json
sleep 1m
ksctl-e2e-amd64 -op scaleup -file civo/scaleup-ha-kubeadm.json
kubectl get nodes -owide
jq -r . ~/.ksctl/state/civo/ha/test-e2e-kubeadm-ha-civo\ PHX1/state.json
- name: scaledown k3
if: steps.changes.outputs.paths == 'true'
run: |
set -xe
ksctl-e2e-amd64 -op switch -file civo/switch-ha.json
sleep 30s
ksctl-e2e-amd64 -op scaledown -file civo/scaledown-ha.json
kubectl get nodes -owide
jq -r . ~/.ksctl/state/civo/ha/test-e2e-ha-civo\ FRA1/state.json
- name: scaleup k3
if: steps.changes.outputs.paths == 'true'
run: |
set -xe
ksctl-e2e-amd64 -op switch -file civo/switch-ha.json
sleep 30s
ksctl-e2e-amd64 -op scaleup -file civo/scaleup-ha.json
kubectl get nodes -owide
jq -r . ~/.ksctl/state/civo/ha/test-e2e-ha-civo\ FRA1/state.json
- name: delete (managed)
if: always() && steps.changes.outputs.paths == 'true'
run: |
set -xe
ksctl-e2e-amd64 -op delete -file civo/delete.json
- name: delete (ha k3s)
if: always() && steps.changes.outputs.paths == 'true'
run: |
set -xe
ksctl-e2e-amd64 -op delete -file civo/delete-ha.json
- name: delete (ha kubeadm)
if: always() && steps.changes.outputs.paths == 'true'
run: |
set -xe
ksctl-e2e-amd64 -op delete -file civo/delete-ha-kubeadm.json