-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathconfig.yml
319 lines (274 loc) · 9.19 KB
/
config.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
version: 2.1
orbs:
silta: silta/silta@dev:master
executors:
cicd73:
docker:
- image: wunderio/silta-cicd:circleci-php7.3-node12-composer1-v1
cicd74:
docker:
- image: wunderio/silta-cicd:circleci-php7.4-node14-composer1-v1
cicd80:
docker:
- image: wunderio/silta-cicd:circleci-php8.0-node14-composer2-v1
cicd80v1:
docker:
- image: wunderio/silta-cicd:circleci-php8.0-node14-composer2-v1
cicd82:
docker:
- image: wunderio/silta-cicd:circleci-php8.2-node22-composer2-v1
cicd83:
docker:
- image: wunderio/silta-cicd:circleci-php8.3-node22-composer2-v1
jobs:
site-test:
docker:
- image: alpine/curl
resource_class: small
steps:
- site-query:
site_url: https://master.drupal-project-k8s.dev.wdr.io/_ping.php
- site-query:
site_url: https://master.drupal-project-k8s.silta-aks.wdr.io/_ping.php
commands:
site-query:
parameters:
site_url:
type: string
steps:
- run:
name: Validate site url <<parameters.site_url>>
command: |
curl -u $SITE_TEST_BAUTH <<parameters.site_url>>
# Variables
filter_feature_only: &filter_feature_only
branches:
ignore:
- production
- master
- &test_cluster /feature\/test-cluster(\/.*)?/
- &aws_cluster /feature\/aws-cluster(\/.*)?/
- &aks_cluster /feature\/aks-cluster(\/.*)?/
filter_test_cluster_only: &filter_test_cluster_only
branches:
only:
- *test_cluster
filter_aws_cluster_only: &filter_aws_cluster_only
branches:
only:
- *aws_cluster
filter_aks_cluster_only: &filter_aks_cluster_only
branches:
only:
- *aks_cluster
filter_master_only: &filter_master_only
branches:
only:
- master
filter_production_only: &filter_production_only
branches:
only:
- production
workflows:
version: 2
commit:
jobs:
- approval:
type: approval
name: approve-deployment
filters: *filter_feature_only
- silta/drupal-validate: &drupal-validate
name: validate
# Use custom executor.
executor: cicd83
post-validation:
- run:
name: Helm unit tests
command: |
helm unittest ./charts/silta-release
helm unittest ./charts/drupal
# Build job for feature environments.
# Other jobs defined below extend this job.
- silta/drupal-build: &build
name: build
# Use custom executor.
executor: cicd83
# Uncomment the line below to use the test build of silta cli.
#silta_cli_version: test
codebase-build:
- silta/drupal-composer-install
- silta/npm-install-build
context: silta_dev
requires:
- approve-deployment
filters: *filter_feature_only
# Deploy job for feature environments.
# Other jobs defined below extend this job.
- silta/drupal-deploy: &deploy
name: deploy
# Use custom executor.
executor: cicd83
# Use a local chart during development.
chart_name: "./charts/drupal"
chart_repository: ""
# Uncomment the line below to use the test build of silta cli.
#silta_cli_version: test
pre-release:
- run:
name: Add helm repositories and build local chart
command: |
helm repo add elastic https://helm.elastic.co
helm repo add codecentric https://codecentric.github.io/helm-charts
helm repo add percona https://percona.github.io/percona-helm-charts/
helm dependency build ./charts/drupal
- run:
name: Dry-run helm install
command: |
http_proxy=$SILTA_PROXY HTTPS_PROXY=$SILTA_PROXY \
helm install --dry-run --generate-name ./charts/drupal --values charts/drupal/test.values.yaml
silta_config: silta/silta.yml
context: silta_dev
requires:
- build
filters: *filter_feature_only
# Build job for test cluster.
# Extends the job defined for feature environments.
- silta/drupal-build:
<<: *build
name: build-test
context: silta_test
requires: [ ]
filters: *filter_test_cluster_only
# Deploy job for test cluster.
# Extends the job defined for feature environments.
- silta/drupal-deploy:
<<: *deploy
name: deploy-test
silta_config: silta/silta.yml,silta/silta-test.yml
context: silta_test
requires:
- build-test
filters: *filter_test_cluster_only
# Build job for master environment.
# Extends the job defined for feature environments.
- silta/drupal-build: &build-master
<<: *build
name: build-master
requires: [ ]
filters: *filter_master_only
# Deploy job for master environment.
# Extends the job defined for feature environments.
- silta/drupal-deploy: &deploy-master
<<: *deploy
name: deploy-master
silta_config: silta/silta.yml,silta/silta-master.yml
requires:
- build-master
filters: *filter_master_only
# Build job for master environment in AKS cluster.
# Extends the job defined for master environments.
- silta/drupal-build: &build-master-aks
<<: *build-master
name: build-aks-master
context: silta_aks
# Deploy job for master environment in AKS cluster.
# Extends the job defined for master environments.
- silta/drupal-deploy: &deploy-master-aks
<<: *deploy-master
name: "Deploy master to AKS cluster"
silta_config: silta/silta.yml,silta/silta-master-aks.yml
context: silta_aks
requires:
- build-aks-master
# Build job for AKS cluster.
# Extends the job defined for master environments.
- silta/drupal-build:
<<: *build-master
name: build-aks
context: silta_aks
filters: *filter_aks_cluster_only
# Deploy job for AKS cluster.
# Extends the job defined for feature environments.
- silta/drupal-deploy:
<<: *deploy
name: deploy-aks
silta_config: silta/silta.yml,silta/silta-aks.yml
context: silta_aks
requires:
- build-aks
filters: *filter_aks_cluster_only
# Build job for AWS cluster.
# Extends the job defined for master environments.
- silta/drupal-build:
<<: *build-master
name: build-aws
context: silta_aws
filters: *filter_aws_cluster_only
# Deploy job for AWS cluster.
# Extends the job defined for feature environments.
- silta/drupal-deploy:
<<: *deploy
name: deploy-aws
silta_config: silta/silta.yml,silta/silta-aws.yml
context: silta_aws
requires:
- build-aws
filters: *filter_aws_cluster_only
# Build job for production environment.
# Extends the job defined for master environments.
- silta/drupal-build: &build-prod
<<: *build-master
name: build-prod
context: silta_finland
filters: *filter_production_only
# Build job for production environment in prod-a.wdr.io cluster.
# Extends the job defined for master environments.
- silta/drupal-build:
<<: *build-prod
name: build-prod-a
context: silta_finland_production_a
# Deploy job for production environment.
# Extends the job defined for feature environments.
- silta/drupal-deploy: &deploy-prod
<<: *deploy
name: deploy-prod
silta_config: silta/silta.yml,silta/silta-prod.yml,silta/secrets_prod_signalsciences
decrypt_files: silta/secrets_prod_signalsciences
context: silta_finland
requires:
- build-prod
filters: *filter_production_only
# Deploy job for production environment in prod-a.wdr.io cluster.
# Extends the job defined for feature environments.
- silta/drupal-deploy:
<<: *deploy-prod
name: deploy-prod-a
context: silta_finland_production_a
requires:
- build-prod-a
# Test site availability by requesting _ping.php.
- site-test: &site-test
name: "Site test"
requires:
- "deploy-master"
- "Deploy master to AKS cluster"
filters: *filter_master_only
# Weekly build and deploy master and master-aks environments.
weekly-build:
triggers:
- schedule:
cron: "0 8 * * 5"
filters: *filter_master_only
jobs:
- silta/drupal-validate:
<<: *drupal-validate
- silta/drupal-build:
<<: *build-master
- silta/drupal-deploy:
<<: *deploy-master
- silta/drupal-build:
<<: *build-master-aks
- silta/drupal-deploy:
<<: *deploy-master-aks
- site-test:
<<: *site-test