-
Notifications
You must be signed in to change notification settings - Fork 11
/
.drone.yml
451 lines (406 loc) · 12.6 KB
/
.drone.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
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
# Copyright (c) 2021 SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
kind: pipeline
name: license
steps:
- name: check
image: docker.io/library/golang:1.20
pull: always
commands:
- go install github.com/google/[email protected]
- addlicense -c "SIGHUP s.r.l" -v -l bsd -y "2017-present" --check .
---
kind: pipeline
name: policeman
platform:
os: linux
arch: amd64
depends_on:
- license
steps:
- name: lint
image: quay.io/sighup/policeman
pull: always
environment:
# Identifies false positives like missing 'selector'. On Kustomize is common to don't set them
VALIDATE_KUBERNETES_KUBEVAL: "false"
# We use a lot of copy paste in our code, is intended. So it important to don't use this linter
VALIDATE_JSCPD: "false"
VALIDATE_TERRAFORM_TFLINT: "false"
# hadolint already validated dockerfiles
VALIDATE_DOCKERFILE: "false"
VALIDATE_NATURAL_LANGUAGE: "false"
depends_on:
- clone
- name: render
image: quay.io/sighup/e2e-testing:1.1.0_0.7.0_3.1.1_1.9.4_1.21.12_3.8.7_4.21.1
pull: always
depends_on:
- clone
commands:
- kustomize build katalog/keycloak-operated > keycloak-operated.yml
- kustomize build katalog/keycloak-operator > keycloak-operator.yml
- &check-deprecated-apis
name: check-deprecated-apis-keycloak-operated
image: us-docker.pkg.dev/fairwinds-ops/oss/pluto:v5
pull: always
depends_on:
- render
commands:
# we use --ignore-deprecations because we don't want the CI to fail when the API has not been removed yet.
- /pluto detect $${KUBERNETES_MANIFESTS} --ignore-deprecations --target-versions=k8s=v1.31.0
environment:
KUBERNETES_MANIFESTS: keycloak-operated.yml
- <<: *check-deprecated-apis
name: check-deprecated-apis-keycloak-operator
environment:
KUBERNETES_MANIFESTS: keycloak-operator.yml
---
name: e2e-kubernetes-1.28
kind: pipeline
type: docker
depends_on:
- policeman
platform:
os: linux
arch: amd64
trigger:
ref:
include:
- refs/heads/main
- refs/heads/release-v*
- refs/tags/**
steps:
- name: create-kind-cluster
image: quay.io/sighup/dind-kind-kubectl-kustomize:0.20.0_1.29.1_3.10.0
pull: always
volumes:
- name: dockersock
path: /var/run/docker.sock
depends_on: [clone]
environment:
CLUSTER_VERSION: v1.28.0
CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-128
# /drone/src is the default workdir for the pipeline
# using this folder we don't need to mount another
# shared volume between the steps
KUBECONFIG: /drone/src/kubeconfig-128
commands:
# NOTE: kind's `--wait` flag that waits for the control-plane ot be ready
# does not work when disabling the default CNI. It will always go in timeout.
- kind create cluster --name $${CLUSTER_NAME} --image registry.sighup.io/fury/kindest/node:$${CLUSTER_VERSION} --config katalog/tests/kind-config.yml
# save the kubeconfig so we can use it from other steps.
- kind get kubeconfig --name $${CLUSTER_NAME} > $${KUBECONFIG}
- name: e2e
# KUBECTL 1.28.5 - KUSTOMIZE 3.5.3 - HELM 3.1.1 - YQ 4.21.1 - ISTIOCTL 1.9.4 - FURYCTL 0.9.0 - BATS 1.1.0
image: quay.io/sighup/e2e-testing:1.1.0_0.11.0_3.12.0_1.9.4_1.28.5_3.5.3_4.33.3
pull: always
network_mode: host
environment:
CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-128
KUBECONFIG: /drone/src/kubeconfig-128
depends_on: [create-kind-cluster]
commands:
- bats -t katalog/tests/deploy-keycloak.sh
- bats -t katalog/tests/test-users-keycloak.sh
- name: delete-kind-cluster
image: quay.io/sighup/dind-kind-kubectl-kustomize:0.20.0_1.29.1_3.10.0
volumes:
- name: dockersock
path: /var/run/docker.sock
pull: always
depends_on: [e2e]
environment:
CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-128
commands:
# does not matter if the command fails
- kind delete cluster --name $${CLUSTER_NAME} || true
when:
status:
- success
- failure
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
---
name: e2e-kubernetes-1.29
kind: pipeline
type: docker
depends_on:
- policeman
platform:
os: linux
arch: amd64
trigger:
ref:
include:
- refs/heads/main
- refs/heads/release-v*
- refs/tags/**
steps:
- name: create-kind-cluster
image: quay.io/sighup/dind-kind-kubectl-kustomize:0.20.0_1.29.1_3.10.0
pull: always
volumes:
- name: dockersock
path: /var/run/docker.sock
depends_on: [clone]
environment:
CLUSTER_VERSION: v1.29.0
CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-129
# /drone/src is the default workdir for the pipeline
# using this folder we don't need to mount another
# shared volume between the steps
KUBECONFIG: /drone/src/kubeconfig-129
commands:
# NOTE: kind's `--wait` flag that waits for the control-plane ot be ready
# does not work when disabling the default CNI. It will always go in timeout.
- kind create cluster --name $${CLUSTER_NAME} --image registry.sighup.io/fury/kindest/node:$${CLUSTER_VERSION} --config katalog/tests/kind-config.yml
# save the kubeconfig so we can use it from other steps.
- kind get kubeconfig --name $${CLUSTER_NAME} > $${KUBECONFIG}
- name: e2e
# KUBECTL 1.29.1 - KUSTOMIZE 3.5.3 - HELM 3.12.0 - YQ 4.21.1 - ISTIOCTL 1.9.4 - FURYCTL 0.9.0 - BATS 1.1.0
image: quay.io/sighup/e2e-testing:1.1.0_0.11.0_3.12.0_1.9.4_1.29.1_3.5.3_4.33.3
pull: always
network_mode: host
environment:
CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-129
KUBECONFIG: /drone/src/kubeconfig-129
depends_on: [create-kind-cluster]
commands:
- bats -t katalog/tests/deploy-keycloak.sh
- bats -t katalog/tests/test-users-keycloak.sh
- name: delete-kind-cluster
image: quay.io/sighup/dind-kind-kubectl-kustomize:0.20.0_1.29.1_3.10.0
volumes:
- name: dockersock
path: /var/run/docker.sock
pull: always
depends_on: [e2e]
environment:
CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-129
commands:
# does not matter if the command fails
- kind delete cluster --name $${CLUSTER_NAME} || true
when:
status:
- success
- failure
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
---
name: e2e-kubernetes-1.30
kind: pipeline
type: docker
depends_on:
- policeman
platform:
os: linux
arch: amd64
trigger:
ref:
include:
- refs/heads/main
- refs/heads/release-v*
- refs/tags/**
steps:
- name: create-kind-cluster
image: quay.io/sighup/dind-kind-kubectl-kustomize:0.24.0_1.30.5_3.10.0
pull: always
volumes:
- name: dockersock
path: /var/run/docker.sock
depends_on: [clone]
environment:
CLUSTER_VERSION: v1.30.4
CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-130
# /drone/src is the default workdir for the pipeline
# using this folder we don't need to mount another
# shared volume between the steps
KUBECONFIG: /drone/src/kubeconfig-130
commands:
# NOTE: kind's `--wait` flag that waits for the control-plane ot be ready
# does not work when disabling the default CNI. It will always go in timeout.
- kind create cluster --name $${CLUSTER_NAME} --image registry.sighup.io/fury/kindest/node:$${CLUSTER_VERSION} --config katalog/tests/kind-config.yml
# save the kubeconfig so we can use it from other steps.
- kind get kubeconfig --name $${CLUSTER_NAME} > $${KUBECONFIG}
- name: e2e
# BATS 1.1.0 - HELM 3.12.0 - KUBECTL 1.30.5 - KUSTOMIZE 3.10.0 - YQ 4.33.3
image: quay.io/sighup/e2e-testing:1.1.0_3.12.0_1.30.5_3.10.0_4.33.3
pull: always
network_mode: host
environment:
CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-130
KUBECONFIG: /drone/src/kubeconfig-130
depends_on: [create-kind-cluster]
commands:
- bats -t katalog/tests/deploy-keycloak.sh
- bats -t katalog/tests/test-users-keycloak.sh
- name: delete-kind-cluster
image: quay.io/sighup/dind-kind-kubectl-kustomize:0.24.0_1.30.5_3.10.0
volumes:
- name: dockersock
path: /var/run/docker.sock
pull: always
depends_on: [e2e]
environment:
CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-130
commands:
# does not matter if the command fails
- kind delete cluster --name $${CLUSTER_NAME} || true
when:
status:
- success
- failure
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
---
name: e2e-kubernetes-1.31
kind: pipeline
type: docker
depends_on:
- policeman
platform:
os: linux
arch: amd64
trigger:
ref:
include:
- refs/heads/main
- refs/heads/release-v*
- refs/tags/**
steps:
- name: create-kind-cluster
image: quay.io/sighup/dind-kind-kubectl-kustomize:0.24.0_1.31.1_3.10.0
pull: always
volumes:
- name: dockersock
path: /var/run/docker.sock
depends_on: [clone]
environment:
CLUSTER_VERSION: v1.31.1
CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-131
# /drone/src is the default workdir for the pipeline
# using this folder we don't need to mount another
# shared volume between the steps
KUBECONFIG: /drone/src/kubeconfig-131
commands:
# NOTE: kind's `--wait` flag that waits for the control-plane ot be ready
# does not work when disabling the default CNI. It will always go in timeout.
- kind create cluster --name $${CLUSTER_NAME} --image registry.sighup.io/fury/kindest/node:$${CLUSTER_VERSION} --config katalog/tests/kind-config.yml
# save the kubeconfig so we can use it from other steps.
- kind get kubeconfig --name $${CLUSTER_NAME} > $${KUBECONFIG}
- name: e2e
# BATS 1.1.0 - HELM 3.12.0 - KUBECTL 1.30.5 - KUSTOMIZE 3.10.0 - YQ 4.33.3
image: quay.io/sighup/e2e-testing:1.1.0_3.12.0_1.30.5_3.10.0_4.33.3
pull: always
network_mode: host
environment:
CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-131
KUBECONFIG: /drone/src/kubeconfig-131
depends_on: [create-kind-cluster]
commands:
- bats -t katalog/tests/deploy-keycloak.sh
- bats -t katalog/tests/test-users-keycloak.sh
- name: delete-kind-cluster
image: quay.io/sighup/dind-kind-kubectl-kustomize:0.24.0_1.31.1_3.10.0
volumes:
- name: dockersock
path: /var/run/docker.sock
pull: always
depends_on: [e2e]
environment:
CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-131
commands:
# does not matter if the command fails
- kind delete cluster --name $${CLUSTER_NAME} || true
when:
status:
- success
- failure
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
---
kind: pipeline
name: release
depends_on:
- e2e-kubernetes-1.28
- e2e-kubernetes-1.29
- e2e-kubernetes-1.30
- e2e-kubernetes-1.31
platform:
os: linux
arch: amd64
trigger:
ref:
include:
- refs/tags/**
steps:
- name: prepare-tar-gz
image: alpine:latest
pull: always
depends_on: [ clone ]
commands:
- tar -zcvf fury-kubernetes-keycloak-${DRONE_TAG}.tar.gz katalog/ LICENSE README.md
- name: prepare-release-notes
image: quay.io/sighup/fury-release-notes-plugin:3.7_2.8.4
pull: always
depends_on: [ clone ]
settings:
release_notes_file_path: release-notes.md
- name: publish-prerelease
image: plugins/github-release
pull: always
depends_on:
- prepare-tar-gz
- prepare-release-notes
settings:
api_key:
from_secret: github_token
file_exists: overwrite
files:
- fury-kubernetes-keycloak-${DRONE_TAG}.tar.gz
prerelease: true
overwrite: true
title: "Preview ${DRONE_TAG}"
note: release-notes.md
checksum:
- md5
- sha256
when:
ref:
include:
- refs/tags/v**-rc**
- name: publish-stable
image: plugins/github-release
pull: always
depends_on:
- prepare-tar-gz
- prepare-release-notes
settings:
api_key:
from_secret: github_token
file_exists: overwrite
files:
- fury-kubernetes-keycloak-${DRONE_TAG}.tar.gz
prerelease: false
overwrite: true
title: "Release ${DRONE_TAG}"
note: release-notes.md
checksum:
- md5
- sha256
when:
ref:
exclude:
- refs/tags/v**-rc**
include:
- refs/tags/v**