-
Notifications
You must be signed in to change notification settings - Fork 0
379 lines (379 loc) · 16.1 KB
/
test-mock.bkp.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# name: "Test Functionality of the Mock cli"
# on:
# pull_request:
# paths:
# - '.github/workflows/test-mock.yml'
# - 'cli/**'
# - 'scripts/**'
# - 'go.mod'
# - 'go.sum'
# types: [ labeled, opened, synchronize, reopened ]
# branches: [ main ]
# push:
# paths:
# - 'scripts/**'
# - 'cli/**'
# - '.github/workflows/test-mock.yml'
# - 'go.mod'
# - 'go.sum'
# branches: [ main ]
# jobs:
# ksctl-cli-windows:
# if: |
# (
# github.event.label.name == 'pr/lgtm' ||
# contains(github.event.pull_request.labels.*.name, 'pr/lgtm')
# ) || (
# github.event_name == 'push' &&
# github.ref == 'refs/heads/main'
# )
# runs-on: windows-latest
# env:
# KSCTL_FAKE_FLAG_ENABLED: "1"
# steps:
# - name: Checkout
# uses: actions/checkout@v3
#
# - name: Set up Go
# uses: actions/setup-go@v4
# with:
# go-version: 1.21.0
#
# - name: build ksctl
# run: |
# cd .\scripts
# .\builder.ps1
# cd C:\Users\runneradmin\AppData\Local\ksctl
# .\ksctl.exe version
#
# - name: civo create
# working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl'
# run: |
# .\ksctl.exe create civo -n demo -r LON1 --nodeSizeMP "g4s.kube.small" --version 1.27.1 --verbose -1 -s store-local --yes
#
# .\ksctl.exe create ha-civo -n ha-demo-k3s --nodeSizeDS "fake.small" --version 1.27.1 --nodeSizeLB "fake.small" --nodeSizeCP "fake.small" --nodeSizeWP "fake.small" -s store-local -r LON1 --verbose -1 --yes --bootstrap k3s
#
# .\ksctl.exe create ha-civo -n ha-demo-kubeadm --nodeSizeDS "fake.small" --version 1.27.1 --nodeSizeLB "fake.small" --nodeSizeCP "fake.small" --nodeSizeWP "fake.small" -s store-local -r LON1 --verbose -1 --yes --bootstrap kubeadm
#
# - name: azure create
# working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl'
# run: |
# .\ksctl.exe create azure -n demo -r fake --nodeSizeMP "fake" -s store-local --version 1.27.1 --verbose -1 --yes
#
# .\ksctl.exe create ha-azure -n ha-demo-k3s --nodeSizeDS "fake" --version 1.27.1 --nodeSizeLB "fake" --nodeSizeCP "fake" --nodeSizeWP "fake" -r fake --verbose -1 -s store-local --yes --bootstrap k3s
#
# .\ksctl.exe create ha-azure -n ha-demo-kubeadm --nodeSizeDS "fake" --version 1.27.1 --nodeSizeLB "fake" --nodeSizeCP "fake" --nodeSizeWP "fake" -r fake --verbose -1 -s store-local --yes --bootstrap kubeadm
#
# - name: aws create
# working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl'
# run: |
# # .\ksctl.exe create aws -n demo -r fake --nodeSizeMP "fake" --version 1.27.1 -s store-local --verbose -1 --yes
# #
# .\ksctl.exe create ha-aws -n ha-demo-k3s --nodeSizeDS "fake" --version 1.27.1 --nodeSizeLB "fake" --nodeSizeCP "fake" --nodeSizeWP "fake" -r fake --verbose -1 -s store-local --yes --bootstrap k3s
#
# .\ksctl.exe create ha-aws -n ha-demo-kubeadm --nodeSizeDS "fake" --version 1.27.1 --nodeSizeLB "fake" --nodeSizeCP "fake" --nodeSizeWP "fake" -r fake --verbose -1 -s store-local --yes --bootstrap kubeadm
#
# - name: local create
# working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl'
# run: |
# .\ksctl.exe create local -n demolocal --version 1.27.1 --verbose -1 -s store-local --yes
#
# - name: civo get
# working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl'
# run: |
# .\ksctl.exe get -s store-local -p civo
#
# - name: azure get
# working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl'
# run: |
# .\ksctl.exe get -s store-local -p azure
#
# - name: aws get
# working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl'
# run: |
# .\ksctl.exe get -s store-local -p aws
#
# - name: get all
# working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl'
# run: |
# .\ksctl.exe get -s store-local
#
# - name: civo switch
# working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl'
# run: |
# .\ksctl.exe switch -p civo -n demo -s store-local -r LON1
# .\ksctl.exe switch -p ha-civo -n ha-demo-k3s -s store-local -r LON1 --bootstrap k3s
# .\ksctl.exe switch -p ha-civo -n ha-demo-kubeadm -s store-local -r LON1 --bootstrap kubeadm
#
# - name: aws switch
# working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl'
# run: |
# # .\ksctl.exe switch -p aws -n demo -s store-local -r fake
# .\ksctl.exe switch -p ha-aws -n ha-demo-k3s -s store-local -r fake --bootstrap k3s
# .\ksctl.exe switch -p ha-aws -n ha-demo-kubeadm -s store-local -r fake --bootstrap kubeadm
#
# - name: azure switch
# working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl'
# run: |
# .\ksctl.exe switch -p azure -n demo -s store-local -r fake
# .\ksctl.exe switch -p ha-azure -n ha-demo-k3s -s store-local -r fake --bootstrap k3s
# .\ksctl.exe switch -p ha-azure -n ha-demo-kubeadm -s store-local -r fake --bootstrap kubeadm
#
# - name: civo scale up and down
# working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl'
# run: |
# .\ksctl.exe delete ha-civo del-nodes -n ha-demo-k3s --noWP 0 -r LON1 -s store-local --yes -v -1 --bootstrap k3s
# .\ksctl.exe create ha-civo add-nodes -n ha-demo-k3s --noWP 1 --version 1.27.1 --nodeSizeWP "fake.small" -s store-local -r LON1 -v -1 --yes --bootstrap k3s
#
# .\ksctl.exe delete ha-civo del-nodes -n ha-demo-kubeadm --noWP 0 -r LON1 -s store-local --yes -v -1 --bootstrap kubeadm
# .\ksctl.exe create ha-civo add-nodes -n ha-demo-kubeadm --noWP 1 --version 1.27.1 --nodeSizeWP "fake.small" -s store-local -r LON1 -v -1 --yes --bootstrap kubeadm
#
# - name: azure scale up and down
# working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl'
# run: |
# .\ksctl.exe delete ha-azure del-nodes -n ha-demo-k3s --noWP 0 -r fake -s store-local --yes -v -1 --bootstrap k3s
# .\ksctl.exe create ha-azure add-nodes -n ha-demo-k3s --noWP 1 --version 1.27.1 --nodeSizeWP "fake" -s store-local -r fake -v -1 --yes --bootstrap k3s
#
# .\ksctl.exe delete ha-azure del-nodes -n ha-demo-kubeadm --noWP 0 -r fake -s store-local --yes -v -1 --bootstrap kubeadm
# .\ksctl.exe create ha-azure add-nodes -n ha-demo-kubeadm --noWP 1 --version 1.27.1 --nodeSizeWP "fake" -s store-local -r fake -v -1 --yes --bootstrap kubeadm
#
# - name: aws scale up and down
# working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl'
# run: |
# .\ksctl.exe delete ha-aws del-nodes -n ha-demo-k3s --noWP 0 -r fake -s store-local --yes -v -1 --bootstrap k3s
# .\ksctl.exe create ha-aws add-nodes -n ha-demo-k3s --noWP 1 --version 1.27.1 --nodeSizeWP "fake" -s store-local -r fake -v -1 --yes --bootstrap k3s
#
# .\ksctl.exe delete ha-aws del-nodes -n ha-demo-kubeadm --noWP 0 -r fake -s store-local --yes -v -1 --bootstrap kubeadm
# .\ksctl.exe create ha-aws add-nodes -n ha-demo-kubeadm --noWP 1 --version 1.27.1 --nodeSizeWP "fake" -s store-local -r fake -v -1 --yes --bootstrap kubeadm
#
# - name: civo delete
# working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl'
# run: |
# .\ksctl.exe delete civo -n demo -r LON1 -s store-local -v -1 --yes
# .\ksctl.exe delete ha-civo -n ha-demo-k3s -r LON1 -s store-local -v -1 --yes --bootstrap k3s
# .\ksctl.exe delete ha-civo -n ha-demo-kubeadm -r LON1 -s store-local -v -1 --yes --bootstrap kubeadm
#
#
# - name: azure delete
# working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl'
# run: |
# .\ksctl.exe delete azure -n demo -r fake -s store-local -v -1 --yes
# .\ksctl.exe delete ha-azure -n ha-demo-k3s -r fake -s store-local -v -1 --yes --bootstrap k3s
# .\ksctl.exe delete ha-azure -n ha-demo-kubeadm -r fake -s store-local -v -1 --yes --bootstrap kubeadm
#
# - name: aws delete
# working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl'
# run: |
# # .\ksctl.exe delete aws -n demo -r fake -s store-local -v -1 --yes
# .\ksctl.exe delete ha-aws -n ha-demo-k3s -r fake -s store-local -v -1 --yes --bootstrap k3s
# .\ksctl.exe delete ha-aws -n ha-demo-kubeadm -r fake -s store-local -v -1 --yes --bootstrap kubeadm
#
# - name: local delete
# working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl'
# run: |
# .\ksctl.exe delete local -n demolocal -s store-local -v -1 --yes
#
# ksctl-cli-unix:
# strategy:
# matrix:
# os: [macos-latest, ubuntu-latest]
#
# if: |
# (
# github.event.label.name == 'pr/lgtm' ||
# contains(github.event.pull_request.labels.*.name, 'pr/lgtm')
# ) || (
# github.event_name == 'push' &&
# github.ref == 'refs/heads/main'
# )
# runs-on: ${{ matrix.os }}
# env:
# KSCTL_FAKE_FLAG_ENABLED: "1"
# PS4: '+\[\033[0;33m\](\[\033[0;36m\]${BASH_SOURCE##*/}:${LINENO}\[\033[0;33m\])\[\033[0m\] '
# steps:
# - name: Checkout
# uses: actions/checkout@v3
#
# - name: Set up Go
# uses: actions/setup-go@v4
# with:
# go-version: 1.21.0
#
# - name: build ksctl linux
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: |
# set -xe
# make install_linux
# ksctl version
#
# - name: build ksctl macos
# if: ${{ matrix.os == 'macos-latest' }}
# run: |
# set -xe
# make install_macos_intel
# ksctl version
#
# - name: civo create
# run: |
# set -xe
# ksctl create civo -n demo -r LON1 --nodeSizeMP "g4s.kube.small" --version 1.27.1 -s store-local --verbose -1 --yes
# ksctl create ha-civo -n ha-demo --nodeSizeDS "fake.small" -s store-local --version 1.27.1 --nodeSizeLB "fake.small" --nodeSizeCP "fake.small" --nodeSizeWP "fake.small" -r LON1 --verbose -1 --yes
#
# - name: azure create
# run: |
# set -xe
# ksctl create azure -n demo -r fake --nodeSizeMP "fake" -s store-local --version 1.27.1 --verbose -1 --yes
# ksctl create ha-azure -n ha-demo --nodeSizeDS "fake" -s store-local --nodeSizeLB "fake" --version 1.27.1 --nodeSizeCP "fake" --nodeSizeWP "fake" -r fake --verbose -1 --yes
#
# - name: aws create
# run: |
# set -xe
# # ksctl create aws -n demo -r fake --nodeSizeMP "fake" -s store-local --version 1.27.1 --verbose -1 --yes
# ksctl create ha-aws -n ha-demo --nodeSizeDS "fake" -s store-local --nodeSizeLB "fake" --version 1.27.1 --nodeSizeCP "fake" --nodeSizeWP "fake" -r fake --verbose -1 --yes
#
# - name: local create
# run: |
# set -xe
# ksctl create local -n demolocal -s store-local --verbose -1 --yes
#
# - name: local create mongodb
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: |
# set -xe
# unset KSCTL_FAKE_FLAG_ENABLED
# docker run -d \
# --name mongodb \
# -p 27017:27017 \
# -e MONGO_INITDB_ROOT_USERNAME=root \
# -e MONGO_INITDB_ROOT_PASSWORD=1234 \
# mongo
# export MONGODB_URI="mongodb://root:1234@127.0.0.1:27017"
# ksctl create local -n demolocal-extmongo -s external-store-mongodb --verbose -1 --yes
#
# - name: civo get
# run: |
# set -xe
# ksctl get -p civo -s store-local
#
# - name: azure get
# run: |
# set -xe
# ksctl get -p azure -s store-local
#
# - name: aws get
# run: |
# set -xe
# ksctl get -p aws -s store-local
#
# - name: local get
# run: |
# set -xe
# ksctl get -p local -s store-local
#
# - name: local get mongo
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: |
# set -xe
# unset KSCTL_FAKE_FLAG_ENABLED
# export MONGODB_URI="mongodb://root:1234@127.0.0.1:27017"
# ksctl get -p local -s external-store-mongodb
#
# - name: all
# run: |
# set -xe
# ksctl get -s store-local
#
# - name: all mongodb
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: |
# set -xe
# unset KSCTL_FAKE_FLAG_ENABLED
# export MONGODB_URI="mongodb://root:1234@127.0.0.1:27017"
# ksctl get -s external-store-mongodb
#
# - name: local switch
# run: |
# set -xe
# ksctl switch -p local -n demolocal -s store-local
#
# - name: local switch mongodb
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: |
# set -xe
# unset KSCTL_FAKE_FLAG_ENABLED
# export MONGODB_URI="mongodb://root:1234@127.0.0.1:27017"
# ksctl switch -p local -n demolocal-extmongo -s external-store-mongodb
#
# - name: civo switch
# run: |
# set -xe
# ksctl switch -p civo -n demo -s store-local -r LON1
# ksctl switch -p ha-civo -n ha-demo -s store-local -r LON1
#
# - name: azure switch
# run: |
# set -xe
# ksctl switch -p azure -n demo -s store-local -r fake
# ksctl switch -p ha-azure -n ha-demo -s store-local -r fake
#
# - name: aws switch
# run: |
# set -xe
# # ksctl switch -p aws -n demo -s store-local -r fake
# ksctl switch -p ha-aws -n ha-demo -s store-local -r fake
#
# - name: civo scale up and down
# run: |
# set -xe
# ksctl delete ha-civo del-nodes -n ha-demo --noWP 0 -r LON1 -s store-local --yes -v -1
# ksctl create ha-civo add-nodes -n ha-demo --noWP 1 --version 1.27.1 --nodeSizeWP "fake.small" -s store-local -r LON1 -v -1 --yes
#
# - name: azure scale up and down
# run: |
# set -xe
# ksctl delete ha-azure del-nodes -n ha-demo --noWP 0 -s store-local -r fake --yes -v -1
# ksctl create ha-azure add-nodes -n ha-demo --noWP 1 --version 1.27.1 --nodeSizeWP "fake" -s store-local -r fake -v -1 --yes
#
# - name: aws scale up and down
# run: |
# set -xe
# ksctl delete ha-aws del-nodes -n ha-demo --noWP 0 -s store-local -r fake --yes -v -1
# ksctl create ha-aws add-nodes -n ha-demo --noWP 1 --version 1.27.1 --nodeSizeWP "fake" -s store-local -r fake -v -1 --yes
#
# - name: civo delete
# run: |
# set -xe
# ksctl delete civo -n demo -r LON1 -s store-local -v -1 --yes
# ksctl delete ha-civo -n ha-demo -r LON1 -s store-local -v -1 --yes
#
# - name: azure delete
# run: |
# set -xe
# ksctl delete azure -n demo -r fake -s store-local -v -1 --yes
# ksctl delete ha-azure -n ha-demo -r fake -s store-local -v -1 --yes
#
# - name: aws delete
# run: |
# set -xe
# # ksctl delete aws -n demo -r fake -s store-local -v -1 --yes
# ksctl delete ha-aws -n ha-demo -r fake -s store-local -v -1 --yes
#
# - name: local delete
# run: |
# set -xe
# ksctl delete local -n demolocal -v -1 -s store-local --yes
#
# - name: local delete mongodb
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: |
# set -xe
# unset KSCTL_FAKE_FLAG_ENABLED
# export MONGODB_URI="mongodb://root:1234@127.0.0.1:27017"
# ksctl delete local -n demolocal-extmongo -v -1 -s external-store-mongodb --yes
#
# - name: storage provider
# run: |
# set -xe
# ksctl create local -n demolocal -s store-local -v -1 --yes
# ksctl create local -n demolocal -s external-store-mongodb -v -1 --yes || echo "Expected to fail :) due to missing env vars"
# ksctl create local -n demolocal -s store-local123 -v -1 --yes || echo "Expected to fail :) due to invalid provider name"