-
Notifications
You must be signed in to change notification settings - Fork 27
/
create-cloudfoundry.yml
7415 lines (6720 loc) · 258 KB
/
create-cloudfoundry.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
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
meta:
resources:
get-paas-cf: &get-paas-cf
get: paas-cf
params: &get-paas-cf-params
submodule_recursive: 'false' # git-resource issue 307
containers:
alpine: &alpine-image-resource
type: registry-image
source:
repository: ghcr.io/alphagov/paas/alpine
tag: 9d7b91294e91172c6f2d63caae4c7b645fc46036
psql: &psql-image-resource
type: registry-image
source:
repository: ghcr.io/alphagov/paas/psql
tag: 9d7b91294e91172c6f2d63caae4c7b645fc46036
node: &node-image-resource
type: registry-image
source:
repository: ghcr.io/alphagov/paas/node
tag: 9d7b91294e91172c6f2d63caae4c7b645fc46036
node-chromium: &node-chromium-image-resource
type: registry-image
source:
repository: ghcr.io/alphagov/paas/node-chromium
tag: 9d7b91294e91172c6f2d63caae4c7b645fc46036
awscli: &awscli-image-resource
type: registry-image
source:
repository: ghcr.io/alphagov/paas/awscli
tag: 9d7b91294e91172c6f2d63caae4c7b645fc46036
bosh-cli-v2: &gov-paas-bosh-cli-v2-image-resource
type: registry-image
source:
repository: ghcr.io/alphagov/paas/bosh-cli-v2
tag: 9d7b91294e91172c6f2d63caae4c7b645fc46036
concourse-tools: &concourse-tools-image-resource
type: registry-image
source:
repository: ghcr.io/alphagov/paas/concourse-tools
tag: 9d7b91294e91172c6f2d63caae4c7b645fc46036
cf-acceptance-tests: &cf-acceptance-tests-image-resource
type: registry-image
source:
repository: ghcr.io/alphagov/paas/cf-acceptance-tests
tag: 9d7b91294e91172c6f2d63caae4c7b645fc46036
cf-cli: &cf-cli-image-resource
type: registry-image
source:
repository: ghcr.io/alphagov/paas/cf-cli
tag: 9d7b91294e91172c6f2d63caae4c7b645fc46036
cf-uaac: &cf-uaac-image-resource
type: registry-image
source:
repository: ghcr.io/alphagov/paas/cf-uaac
tag: 9d7b91294e91172c6f2d63caae4c7b645fc46036
git-ssh: &git-ssh-image-resource
type: registry-image
source:
repository: ghcr.io/alphagov/paas/git-ssh
tag: 9d7b91294e91172c6f2d63caae4c7b645fc46036
ruby-slim: &ruby-slim-image-resource
type: registry-image
source:
repository: ghcr.io/alphagov/paas/ruby
tag: 9d7b91294e91172c6f2d63caae4c7b645fc46036
golang: &golang-image-resource
type: registry-image
source:
repository: ghcr.io/alphagov/paas/golang
tag: 9d7b91294e91172c6f2d63caae4c7b645fc46036
terraform: &terraform-image-resource
type: registry-image
source:
repository: ghcr.io/alphagov/paas/terraform
tag: 9d7b91294e91172c6f2d63caae4c7b645fc46036
curl-ssl: &curl-ssl-image-resource
type: registry-image
source:
repository: ghcr.io/alphagov/paas/curl-ssl
tag: 9d7b91294e91172c6f2d63caae4c7b645fc46036
tasks:
- &add-grafana-job-annotation
try:
put: grafana-job-annotation
tags: [colocated-with-web]
params:
tags: [incomplete]
- &end-grafana-job-annotation
try:
put: grafana-job-annotation
tags: [colocated-with-web]
params:
path: grafana-job-annotation
tags: [completed]
- &add-grafana-overview-annotation
try:
do:
- put: grafana-overview-annotation
tags: [colocated-with-web]
params:
tags: [incomplete]
- put: grafana-overview-annotation-id
params:
file: grafana-overview-annotation/id
- &end-grafana-overview-annotation
try:
do:
- get: grafana-overview-annotation-id
- task: consume-grafana-overview-annotation-id
tags: [colocated-with-web]
config:
platform: linux
inputs:
- name: grafana-overview-annotation-id
image_resource: *cf-cli-image-resource
run:
path: echo
- put: grafana-overview-annotation
tags: [colocated-with-web]
params:
path: grafana-overview-annotation-id
tags: [complete]
groups:
- name: deploy
jobs:
- pipeline-lock
- pre-deploy
- generate-secrets
- app-availability-tests
- internal-app-availability-tests
- api-availability-tests
- cf-terraform
- psn-terraform
- az-healthcheck-terraform
- vpc-peering-terraform
- dms-terraform
- generate-cf-config
- cf-deploy
- app-autoscaler-deploy
- prometheus-deploy
- post-cf-deploy
- post-bosh-deploys
- deploy-paas-accounts
- deploy-paas-admin
- deploy-paas-auditor
- deploy-paas-billing
- deploy-paas-metrics
- deploy-paas-aiven-broker
- deploy-paas-prometheus-endpoints
- smoke-tests
- acceptance-tests
- custom-acceptance-tests
- custom-broker-acceptance-tests
- app-autoscaler-acceptance-tests
- bosh-tests
- rotate-certs
- check-certificates-after-rotation
- tag-release
- pipeline-unlock
- name: platform-core
jobs:
- pipeline-lock
- pre-deploy
- generate-secrets
- app-availability-tests
- internal-app-availability-tests
- api-availability-tests
- cf-terraform
- psn-terraform
- vpc-peering-terraform
- dms-terraform
- generate-cf-config
- cf-deploy
- app-autoscaler-deploy
- prometheus-deploy
- post-cf-deploy
- post-bosh-deploys
- smoke-tests
- acceptance-tests
- custom-acceptance-tests
- custom-broker-acceptance-tests
- app-autoscaler-acceptance-tests
- bosh-tests
- tag-release
- pipeline-unlock
- name: platform-services
jobs:
- deploy-paas-accounts
- deploy-paas-admin
- deploy-paas-auditor
- deploy-paas-billing
- deploy-paas-metrics
- deploy-paas-aiven-broker
- name: operator
jobs:
- generate-git-keys
- generate-paas-admin-git-keys
- generate-paas-aiven-broker-git-keys
- generate-paas-billing-git-keys
- show-release-version
- bump-minor-version
- bump-major-version
- bump-patch-version
- pipeline-check-lock
- pipeline-release-lock
- healthcheck-check-state
- healthcheck-disable
- cleanup-deleted-cf-users
- disable-az-a-vpc
- enable-az-a-vpc
- disable-az-b-vpc
- enable-az-b-vpc
- disable-az-c-vpc
- enable-az-c-vpc
- name: tests
jobs:
- app-availability-tests
- internal-app-availability-tests
- api-availability-tests
- smoke-tests
- acceptance-tests
- custom-acceptance-tests
- custom-broker-acceptance-tests
- app-autoscaler-acceptance-tests
- bosh-tests
- name: health
jobs:
- continuous-smoke-tests
- continuous-billing-smoke-tests
- continuous-leaked-aws-key-check
- check-certificates
- resurrector-is-enabled
- check-billing-comparison-with-cf
- az-a-is-enabled-in-manifest
- az-b-is-enabled-in-manifest
- az-c-is-enabled-in-manifest
- az-a-is-enabled-in-vpc
- az-b-is-enabled-in-vpc
- az-c-is-enabled-in-vpc
- az-healthcheck-terraform
- az-a-healthcheck
- az-b-healthcheck
- az-c-healthcheck
- name: credentials
jobs:
- set-smoke-test-creds
- rotate-cloudfoundry-credentials
- rotate-broker-credentials
- rotate-database-encryption-keys
- rotate-prometheus-credentials
- expire-aws-keys
- rotate-cf-admin-password
resource_types:
# FIX ME: The server certificate verification fails when using the concourse
# version of the resource_type `git`. As a temporary fix we have docker image
# of the resource. This resource_type can be deleted when the issue is resolved
- name: git
type: registry-image
source:
repository: ghcr.io/alphagov/paas/git-resource
tag: 1f84d4a76b4a2491283e0107ae7ed4bc83c84d1b
- name: pinned-pool
type: registry-image
source:
repository: ghcr.io/alphagov/paas/concourse-pool-resource
tag: 272908a4012b68c01301d9af9270d3fdf2b1d978
- name: s3-iam
type: registry-image
source:
repository: ghcr.io/alphagov/paas/s3-resource
tag: 96b47010a10ca13b40bc604b49b4ab9158cfe2c7
- name: semver-iam
type: registry-image
source:
repository: ghcr.io/alphagov/paas/semver-resource
tag: f2a80c95481056aa57d837e3b14f0012b542fdb3
- name: grafana-annotation
type: registry-image
source:
repository: ghcr.io/alphagov/paas/grafana-annotation-resource
tag: 140506423e1194319fc1e2ed7f8d04a36ca61ae3
- name: slack-notification-resource
type: registry-image
source:
repository: ghcr.io/alphagov/paas/slack-notification-resource
tag: edd15a5700df670874871fe03fa098e28d89faea
resources:
- name: pipeline-trigger
type: semver-iam
source:
bucket: ((state_bucket))
region_name: ((aws_region))
key: ((pipeline_trigger_file))
- name: paas-cf
type: git
source:
uri: https://github.com/alphagov/paas-cf.git
branch: ((branch_name))
tag_filter: ((paas_cf_tag_filter))
commit_verification_keys: ((gpg_public_keys))
- name: vpc-tfstate
type: s3-iam
source:
bucket: ((state_bucket))
region_name: ((aws_region))
versioned_file: vpc.tfstate
- name: concourse-tfstate
type: s3-iam
source:
bucket: ((state_bucket))
versioned_file: concourse.tfstate
region_name: ((aws_region))
- name: bosh-tfstate
type: s3-iam
source:
bucket: ((state_bucket))
region_name: ((aws_region))
versioned_file: bosh.tfstate
- name: git-ssh-private-key
type: s3-iam
source:
bucket: ((state_bucket))
versioned_file: git_id_rsa
region_name: ((aws_region))
- name: cf-tfstate
type: s3-iam
source:
bucket: ((state_bucket))
versioned_file: cf.tfstate
region_name: ((aws_region))
initial_version: "-"
initial_content_text: |
{
"version": 4,
"terraform_version": "1.2.0",
"serial": 0,
"outputs": {},
"resources": []
}
- name: az-management-a-tfstate
type: s3-iam
source:
bucket: ((state_bucket))
versioned_file: az-management-a.tfstate
region_name: ((aws_region))
initial_version: "-"
initial_content_text: |
{
"version": 4,
"terraform_version": "1.2.0",
"serial": 0,
"outputs": {},
"resources": []
}
- name: az-management-b-tfstate
type: s3-iam
source:
bucket: ((state_bucket))
versioned_file: az-management-b.tfstate
region_name: ((aws_region))
initial_version: "-"
initial_content_text: |
{
"version": 4,
"terraform_version": "1.2.0",
"serial": 0,
"outputs": {},
"resources": []
}
- name: az-management-c-tfstate
type: s3-iam
source:
bucket: ((state_bucket))
versioned_file: az-management-c.tfstate
region_name: ((aws_region))
initial_version: "-"
initial_content_text: |
{
"version": 4,
"terraform_version": "1.2.0",
"serial": 0,
"outputs": {},
"resources": []
}
- name: vpc-peering-tfstate
type: s3-iam
source:
bucket: ((state_bucket))
versioned_file: vpc-peering.tfstate
region_name: ((aws_region))
initial_version: "-"
initial_content_text: |
{
"version": 4,
"terraform_version": "1.2.0",
"serial": 0,
"outputs": {},
"resources": []
}
- name: cyber-tfstate
type: s3-iam
source:
bucket: ((state_bucket))
versioned_file: cyber.tfstate
region_name: ((aws_region))
initial_version: "-"
initial_content_text: |
{
"version": 4,
"terraform_version": "1.2.0",
"serial": 0,
"outputs": {},
"resources": []
}
- name: psn-tfstate
type: s3-iam
source:
bucket: ((state_bucket))
versioned_file: psn.tfstate
region_name: ((aws_region))
initial_version: "-"
initial_content_text: |
{
"version": 4,
"terraform_version": "1.2.0",
"serial": 0,
"outputs": {"psn_security_group_seed_json": {
"value": "[]",
"type": "string"
}},
"resources": []
}
- name: az-healthcheck-tfstate
type: s3-iam
source:
bucket: ((state_bucket))
versioned_file: azhc.tfstate
region_name: ((aws_region))
initial_version: "-"
initial_content_text: |
{
"version": 4,
"terraform_version": "1.2.0",
"serial": 0,
"outputs": {
"healthcheck_address_a": { "value": "", "type": "string" },
"healthcheck_address_b": { "value": "", "type": "string" },
"healthcheck_address_c": { "value": "", "type": "string" }
},
"resources": []
}
- name: dms-tfstate
type: s3-iam
source:
bucket: ((state_bucket))
versioned_file: dms.tfstate
region_name: ((aws_region))
initial_version: "-"
initial_content_text: |
{
"version": 4,
"terraform_version": "1.2.0",
"serial": 0,
"outputs": {},
"resources": []
}
- name: cf-manifest
type: s3-iam
source:
bucket: ((state_bucket))
region_name: ((aws_region))
versioned_file: cf-manifest.yml
- name: cf-manifest-pre-vars
type: s3-iam
source:
bucket: ((state_bucket))
region_name: ((aws_region))
versioned_file: cf-manifest-pre-vars.yml
- name: paas-cf-cloud-config
type: s3-iam
source:
bucket: ((state_bucket))
region_name: ((aws_region))
versioned_file: paas-cf-cloud-config.yml
- name: paas-cf-runtime-config
type: s3-iam
source:
bucket: ((state_bucket))
region_name: ((aws_region))
versioned_file: paas-cf-runtime-config.yml
- name: paas-trusted-people
type: s3-iam
source:
bucket: ((state_bucket))
region_name: ((aws_region))
versioned_file: paas-trusted-people/users.yml
initial_version: "-"
initial_content_text: ""
- name: deployed-healthcheck
type: s3-iam
source:
bucket: ((state_bucket))
region_name: ((aws_region))
versioned_file: healthcheck-deployed
initial_version: "-"
initial_content_text: "no"
- name: cf-acceptance-tests
type: git
source:
uri: https://github.com/cloudfoundry/cf-acceptance-tests
branch: cf32.7
- name: cf-smoke-tests-release
type: git
source:
uri: https://github.com/cloudfoundry/cf-smoke-tests-release
tag_filter: "42.0.93"
submodules:
- "src/smoke_tests"
- name: smoke-test-config
type: s3-iam
source:
bucket: ((state_bucket))
region_name: ((aws_region))
versioned_file: smoke-test-config.json
- name: git-keys
type: s3-iam
source:
bucket: ((state_bucket))
region_name: ((aws_region))
versioned_file: git-keys.tar.gz
initial_version: "-"
# This is an empty tar.gz file base64 encoded
initial_content_binary: "H4sICMtSp1YAA2NvbmNvdXJzZS1jZXJ0cy50YXIA7cEBDQAAAMKg909tDjegAAAAAAAAAAAAgDcDmt4dJwAoAAA="
- name: release-version
type: semver-iam
source:
bucket: ((state_bucket))
region_name: ((aws_region))
key: release-version
initial_version: 0.0.0
- name: pipeline-pool
type: pinned-pool
source:
uri: ((git_concourse_pool_clone_full_url_ssh))
branch: main
pool: ((pipeline_name))
private_key: ((pipeline_lock_git_private_key))
- name: smoke-tests-timer
type: time
source:
interval: 5m
- name: resurrector-is-enabled-timer
type: time
source:
interval: 30m
- name: az-is-enabled-in-manifest-timer
type: time
source:
interval: 30m
- name: az-is-enabled-in-vpc-timer
type: time
source:
interval: 30m
- name: az-healthcheck-timer
type: time
source:
interval: 10m
- name: billing-smoke-tests-timer
type: time
source:
interval: 5m
location: Europe/London
start: 9:00 AM
stop: 5:00 PM
days: [Monday, Tuesday, Wednesday, Thursday, Friday]
- name: leaked-aws-key-check-timer
type: time
source:
interval: 20m
- name: check-certificates-timer
type: time
source:
interval: 24h
- name: expire-aws-keys-timer
type: time
source:
interval: 720h
- name: paas-aiven-broker
type: git
source:
uri: https://github.com/alphagov/paas-aiven-broker.git
branch: main
tag_filter: ((deploy_env_tag_prefix))
commit_verification_keys: ((gpg_public_keys))
- name: paas-billing
type: git
source:
uri: https://github.com/alphagov/paas-billing.git
branch: main
tag_filter: ((deploy_env_tag_prefix))
commit_verification_keys: ((gpg_public_keys))
- name: paas-accounts
type: git
source:
uri: https://github.com/alphagov/paas-accounts.git
branch: main
tag_filter: v0.34.0
- name: paas-auditor
type: git
source:
uri: https://github.com/alphagov/paas-auditor.git
branch: main
tag_filter: v0.76.0
- name: paas-admin
type: git
source:
uri: https://github.com/alphagov/paas-admin.git
branch: main
tag_filter: ((deploy_env_tag_prefix))
commit_verification_keys: ((gpg_public_keys))
- name: paas-prometheus-endpoints
type: git
source:
uri: https://github.com/alphagov/paas-prometheus-endpoints.git
branch: main
tag_filter: v0.20.0
- name: prometheus-manifest-pre-vars
type: s3-iam
source:
bucket: ((state_bucket))
region_name: ((aws_region))
versioned_file: prometheus-manifest-pre-vars.yml
- name: app-autoscaler-manifest-pre-vars
type: s3-iam
source:
bucket: ((state_bucket))
region_name: ((aws_region))
versioned_file: app-autoscaler-manifest-pre-vars.yml
- name: yet-another-cloudwatch-exporter
type: git
source:
uri: https://github.com/nerdswords/yet-another-cloudwatch-exporter.git
fetch_tags: true
version:
# v0.53.0
ref: 2fd8cd322931aeb5a39c457ede31022e67f479b9
- name: pingdom-exporter
type: git
source:
uri: https://github.com/jusbrasil/pingdom-exporter
fetch_tags: true
version:
# v1.4.0
ref: 162b570480a101ae9697658faae57dc42ff3c5db
- name: grafana-overview-annotation-id
type: s3-iam
source:
bucket: ((state_bucket))
region_name: ((aws_region))
versioned_file: grafana-overview-annotation-id/id
- name: grafana-overview-annotation
type: grafana-annotation
tags: [colocated-with-web]
source:
url: https://grafana-1.((system_dns_zone_name))
username: admin
password: ((grafana_password))
tags:
- deployment-overview
- concourse
- create-cloudfoundry
template: |
${BUILD_PIPELINE_NAME}
${ATC_EXTERNAL_URL}/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}
- name: grafana-job-annotation
type: grafana-annotation
tags: [colocated-with-web]
source:
url: https://grafana-1.((system_dns_zone_name))
username: admin
password: ((grafana_password))
tags:
- deployment
- concourse
- create-cloudfoundry
template: |
${BUILD_PIPELINE_NAME}/${BUILD_JOB_NAME}
${ATC_EXTERNAL_URL}/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}
- name: slack-notification
type: slack-notification-resource
source:
url: ((cyber_slack_webhook_url))
jobs:
- name: pipeline-lock
serial: true
plan:
- in_parallel:
- <<: *get-paas-cf
trigger: ((auto_deploy))
- get: git-ssh-private-key
- task: init-pipeline-pool
tags: [colocated-with-web]
config:
platform: linux
image_resource: *git-ssh-image-resource
inputs:
- name: paas-cf
- name: git-ssh-private-key
params:
DEPLOY_ENV: ((deploy_env))
AWS_ACCOUNT: ((aws_account))
DISABLE_PIPELINE_LOCKING: ((disable_pipeline_locking))
run:
path: sh
args:
- -e
- -c
- |
if [ "${DISABLE_PIPELINE_LOCKING:-}" = "true" ] ; then
echo "Pipeline locking is disabled, skipping..."
exit 0
fi
chmod 600 git-ssh-private-key/git_id_rsa
git config --global push.default simple
git config --global user.email "concourse@${DEPLOY_ENV}.${AWS_ACCOUNT}"
git config --global user.name "Concourse server ${DEPLOY_ENV} in ${AWS_ACCOUNT}"
./paas-cf/concourse/scripts/create_pool_lock.sh \
"((git_concourse_pool_clone_full_url_ssh))" \
"$(pwd)/git-ssh-private-key/git_id_rsa" \
"((pipeline_name))" lock
- try:
task: lock-the-pipeline
tags: [colocated-with-web]
config:
image_resource: *alpine-image-resource
platform: linux
params:
DISABLE_PIPELINE_LOCKING: ((disable_pipeline_locking))
run:
path: sh
args:
- -e
- -c
- |
if [ "${DISABLE_PIPELINE_LOCKING:-}" = "true" ] ; then
echo "Pipeline locking is disabled, skipping..."
exit 0
fi
echo "About to lock. This job will fail and this is OK."
exit 1
on_failure:
put: pipeline-pool
params:
claim: lock
- task: self-update-pipeline
tags: [colocated-with-web]
config:
platform: linux
image_resource:
type: registry-image
source:
repository: ghcr.io/alphagov/paas/self-update-pipelines
tag: 9d7b91294e91172c6f2d63caae4c7b645fc46036
inputs:
- name: paas-cf
params:
DEPLOY_ENV: ((deploy_env))
BRANCH: ((branch_name))
MAKEFILE_ENV_TARGET: ((makefile_env_target))
AWS_DEFAULT_REGION: ((aws_region))
ENABLE_AZ_HEALTHCHECK: ((enable_az_healthcheck))
SELF_UPDATE_PIPELINE: ((self_update_pipeline))
PIPELINES_TO_UPDATE: ((pipeline_name))
ENABLE_ALERT_NOTIFICATIONS: ((ENABLE_ALERT_NOTIFICATIONS))
BOSH_AZ: ((bosh_az))
SKIP_AWS_CREDENTIAL_VALIDATION: true
NEW_ACCOUNT_EMAIL_ADDRESS: ((NEW_ACCOUNT_EMAIL_ADDRESS))
SLIM_DEV_DEPLOYMENT: ((slim_dev_deployment))
CONCOURSE_WEB_PASSWORD: ((concourse_web_password))
DISABLED_AZS: ((disabled_azs))
run:
path: ./paas-cf/concourse/scripts/self-update-pipeline.sh
- *add-grafana-overview-annotation
- put: pipeline-trigger
params: {bump: patch}
- name: generate-secrets
serial_groups: [cf-deploy]
serial: true
plan:
- in_parallel:
- <<: *get-paas-cf
passed: ['pipeline-lock']
- get: pipeline-trigger
passed: ['pipeline-lock']
trigger: true
- in_parallel:
- task: generate-cf-secrets
tags: [colocated-with-web]
config:
platform: linux
image_resource: *gov-paas-bosh-cli-v2-image-resource
inputs:
- name: paas-cf
params:
CREDHUB_CLIENT: credhub-admin
CREDHUB_SECRET: ((bosh-credhub-admin))
CREDHUB_CA_CERT: ((bosh-credhub-ca-cert))
CREDHUB_SERVER: "https://((bosh_fqdn)):8844/api"
DEPLOY_ENV: ((deploy_env))
run:
path: bash
args:
- -c
- -e
- |
credhub login
# Most credentials need to be available to concourse and bosh,
# but there are a couple that are only needed by concourse (and not bosh).
#
# We'll set them all in the /concourse/main namespace, then copy the values
# that we need in bosh to the /$DEPLOY_ENV/$DEPLOY_ENV namespace
bosh_credentials=(
external_cc_database_password
external_bbs_database_password
external_locket_database_password
external_uaa_database_password
external_silk_controller_database_password
external_policy_server_database_password
waf_xff_auth_key
)
app_autoscaler_credentials=(
external_app_autoscaler_database_password
)
concourse_credentials=(
secrets_cf_db_master_password
secrets_cdn_db_master_password
"${bosh_credentials[@]}"
"${app_autoscaler_credentials[@]}"
)
for secret_name in ${concourse_credentials[*]}; do
credhub generate --type password --no-overwrite --name "/concourse/main/$secret_name"
done
for secret_name in ${bosh_credentials[*]}; do
value=$(credhub get --name "/concourse/main/$secret_name" --quiet)
credhub set --type password --name "/$DEPLOY_ENV/$DEPLOY_ENV/$secret_name" --password "$value"
done
for secret_name in ${app_autoscaler_credentials[*]}; do
value=$(credhub get --name "/concourse/main/$secret_name" --quiet)
credhub set --type password --name "/$DEPLOY_ENV/app-autoscaler/$secret_name" --password "$value"
done
- task: generate-cf-admin-password
tags: [colocated-with-web]
config:
platform: linux
image_resource: *gov-paas-bosh-cli-v2-image-resource
inputs:
- name: paas-cf
params:
CREDHUB_CLIENT: credhub-admin
CREDHUB_SECRET: ((bosh-credhub-admin))
CREDHUB_CA_CERT: ((bosh-credhub-ca-cert))
CREDHUB_SERVER: "https://((bosh_fqdn)):8844/api"
DEPLOY_ENV: ((deploy_env))
run:
path: bash
args:
- -c
- -e
- |
credhub login
if credhub get -q -n "/${DEPLOY_ENV}/${DEPLOY_ENV}/cf_admin_password" > /dev/null; then
echo "CF Admin Password already set. Skipping."
else
credhub generate -n "/${DEPLOY_ENV}/${DEPLOY_ENV}/cf_admin_password" -t password --no-overwrite
cf_admin_password=$(credhub get -n "/${DEPLOY_ENV}/${DEPLOY_ENV}/cf_admin_password" -q)
credhub set -t password -n "/concourse/main/cf_pass" -w "${cf_admin_password}"
fi
- name: pre-deploy
plan:
- in_parallel:
- get: pipeline-trigger
passed: ['generate-secrets']
trigger: true
- get: deployed-healthcheck
- <<: *get-paas-cf
passed: ['generate-secrets']
- task: wait-for-app-availability-tests
tags: [colocated-with-web]
file: paas-cf/concourse/tasks/wait-for-app-availability-tests.yml
params:
SYSTEM_DNS_ZONE_NAME: ((system_dns_zone_name))
CF_ADMIN: admin
CF_PASS: ((cf_pass))
APP_NAME: healthcheck
- task: wait-for-internal-app-availability-tests
tags: [colocated-with-web]
file: paas-cf/concourse/tasks/wait-for-app-availability-tests.yml
params:
SYSTEM_DNS_ZONE_NAME: ((system_dns_zone_name))
CF_ADMIN: admin
CF_PASS: ((cf_pass))
APP_NAME: healthcheck-pinger
- task: wait-for-api-availability-tests
tags: [colocated-with-web]
file: paas-cf/concourse/tasks/wait-for-api-availability-tests.yml
params:
AWS_DEFAULT_REGION: ((aws_region))