-
Notifications
You must be signed in to change notification settings - Fork 8
/
pipeline.yml
308 lines (291 loc) · 10.5 KB
/
pipeline.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
---
jobs:
- name: test-broker
plan:
- get: pull-request
version: every
trigger: true
- get: broker-src
- get: general-task
- put: pull-request
params:
path: pull-request
status: pending
context: run-tests
- task: run-tests
image: general-task
file: pull-request/run-tests.yml
on_success:
put: pull-request
params:
path: pull-request
status: success
context: run-tests
on_failure:
put: pull-request
params:
path: pull-request
status: failure
context: run-tests
- name: reconfigure
plan:
- get: broker-src
trigger: true
- set_pipeline: deploy-uaa-credentials-broker
file: broker-src/pipeline.yml
- name: push-broker-staging
serial_groups: [staging]
serial: true
plan:
- in_parallel:
- get: broker-src
trigger: true
passed: [reconfigure]
- get: pipeline-tasks
- put: broker-deploy-staging
params:
path: broker-src
manifest: broker-src/manifest.yml
environment_variables:
UAA_ADDRESS: ((uaa-address-staging))
UAA_CLIENT_ID: ((uaa-client-id-staging))
UAA_CLIENT_SECRET: ((uaa-client-secret-staging))
UAA_ZONE: ((uaa-zone-staging))
CF_ADDRESS: ((cf-api-url-staging))
BROKER_USERNAME: ((broker-username-staging))
BROKER_PASSWORD: ((broker-password-staging))
EMAIL_ADDRESS: ((email-address-staging))
- task: update-broker
file: pipeline-tasks/register-service-broker-and-set-plan-visibility.yml
params:
CF_API_URL: ((cf-api-url-staging))
CF_USERNAME: ((cf-deploy-username-staging))
CF_PASSWORD: ((cf-deploy-password-staging))
CF_ORGANIZATION: ((cf-organization-staging))
CF_SPACE: ((cf-space-staging))
BROKER_NAME: uaa-credentials-broker
AUTH_USER: ((broker-username-staging))
AUTH_PASS: ((broker-password-staging))
SERVICES: cloud-gov-service-account cloud-gov-identity-provider
on_failure:
put: slack
params:
text: |
:x: FAILED to deploy uaa-credentials-broker on ((cf-api-url-staging))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-failure-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
on_success:
put: slack
params:
text: |
:white_check_mark: Successfully deployed uaa-credentials-broker on ((cf-api-url-staging))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-success-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
- name: acceptance-tests-staging
serial_groups: [staging]
serial: true
plan:
- get: broker-src
passed: [push-broker-staging]
trigger: true
- get: general-task
- task: acceptance-tests-staging
image: general-task
file: broker-src/acceptance-tests.yml
params:
CF_API_URL: ((cf-api-url-staging))
CF_USERNAME: ((cf-deploy-username-test-staging))
CF_PASSWORD: ((cf-deploy-password-test-staging))
CF_ORGANIZATION: ((cf-organization-test-staging))
CF_SPACE: ((cf-space-test-staging))
UAA_API_URL: ((uaa-address-staging))
UAA_CLIENT_ID: ((uaa-client-id-test-staging))
UAA_CLIENT_SECRET: ((uaa-client-secret-test-staging))
CLIENT_SERVICE_NAME: cloud-gov-identity-provider
USER_SERVICE_NAME: cloud-gov-service-account
CLIENT_PLAN_NAME: oauth-client
USER_PLAN_NAME: space-deployer
SERVICE_INSTANCE_NAME: uaa-credentials-acceptance
- name: push-broker-production
serial_groups: [production]
serial: true
plan:
- in_parallel:
- get: broker-src
passed: [acceptance-tests-staging]
trigger: true
- get: pipeline-tasks
passed: [push-broker-staging]
- put: broker-deploy-production
params:
path: broker-src
manifest: broker-src/manifest.yml
environment_variables:
UAA_ADDRESS: ((uaa-address-production))
UAA_CLIENT_ID: ((uaa-client-id-production))
UAA_CLIENT_SECRET: ((uaa-client-secret-production))
UAA_ZONE: ((uaa-zone-production))
CF_ADDRESS: ((cf-api-url-production))
BROKER_USERNAME: ((broker-username-production))
BROKER_PASSWORD: ((broker-password-production))
EMAIL_ADDRESS: ((email-address-production))
- task: update-broker-identity-provider
file: pipeline-tasks/register-service-broker-and-set-plan-visibility.yml
params:
CF_API_URL: ((cf-api-url-production))
CF_USERNAME: ((cf-deploy-username-production))
CF_PASSWORD: ((cf-deploy-password-production))
CF_ORGANIZATION: ((cf-organization-production))
CF_SPACE: ((cf-space-production))
BROKER_NAME: uaa-credentials-broker
AUTH_USER: ((broker-username-production))
AUTH_PASS: ((broker-password-production))
SERVICES: cloud-gov-identity-provider
- task: update-broker-service-account
file: pipeline-tasks/register-service-broker-and-set-plan-visibility.yml
params:
CF_API_URL: ((cf-api-url-production))
CF_USERNAME: ((cf-deploy-username-production))
CF_PASSWORD: ((cf-deploy-password-production))
CF_ORGANIZATION: ((cf-organization-production))
CF_SPACE: ((cf-space-production))
BROKER_NAME: uaa-credentials-broker
AUTH_USER: ((broker-username-production))
AUTH_PASS: ((broker-password-production))
SERVICES: cloud-gov-service-account
SERVICE_ORGANIZATION_DENYLIST: ((service-account-blacklist))
on_failure:
put: slack
params:
text: |
:x: FAILED to deploy uaa-credentials-broker on ((cf-api-url-production))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-failure-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
on_success:
put: slack
params:
text: |
:white_check_mark: Successfully deployed uaa-credentials-broker on ((cf-api-url-production))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-success-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
- name: acceptance-tests-production
serial_groups: [production]
serial: true
plan:
- get: broker-src
passed: [push-broker-production]
trigger: true
- get: general-task
- task: acceptance-tests-production
image: general-task
file: broker-src/acceptance-tests.yml
params:
CF_API_URL: ((cf-api-url-production))
CF_USERNAME: ((cf-deploy-username-test-production))
CF_PASSWORD: ((cf-deploy-password-test-production))
CF_ORGANIZATION: ((cf-organization-test-production))
CF_SPACE: ((cf-space-test-production))
UAA_API_URL: ((uaa-address-production))
UAA_CLIENT_ID: ((uaa-client-id-test-production))
UAA_CLIENT_SECRET: ((uaa-client-secret-test-production))
CLIENT_SERVICE_NAME: cloud-gov-identity-provider
USER_SERVICE_NAME: cloud-gov-service-account
CLIENT_PLAN_NAME: oauth-client
USER_PLAN_NAME: space-deployer
SERVICE_INSTANCE_NAME: uaa-credentials-acceptance
resources:
- name: broker-src
type: git
source:
uri: https://github.com/cloud-gov/uaa-credentials-broker
branch: main
- name: pipeline-tasks
type: git
source:
uri: https://github.com/cloud-gov/cg-pipeline-tasks
branch: main
commit_verification_keys: ((cloud-gov-pgp-keys))
- name: broker-deploy-staging
type: cf
source:
api: ((cf-api-url-staging))
username: ((cf-deploy-username-staging))
password: ((cf-deploy-password-staging))
organization: ((cf-organization-staging))
space: ((cf-space-staging))
- name: broker-deploy-production
type: cf
source:
api: ((cf-api-url-production))
username: ((cf-deploy-username-production))
password: ((cf-deploy-password-production))
organization: ((cf-organization-production))
space: ((cf-space-production))
- name: slack
type: slack-notification
source:
url: ((slack-webhook-url))
- name: pull-request
type: pull-request
check_every: 1m
source:
repository: cloud-gov/uaa-credentials-broker
access_token: ((status-access-token))
disable_forks: true
- name: general-task
type: registry-image
source:
aws_access_key_id: ((ecr_aws_key))
aws_secret_access_key: ((ecr_aws_secret))
repository: general-task
aws_region: us-gov-west-1
tag: latest
resource_types:
- name: slack-notification
type: registry-image
source:
aws_access_key_id: ((ecr_aws_key))
aws_secret_access_key: ((ecr_aws_secret))
repository: slack-notification-resource
aws_region: us-gov-west-1
tag: latest
- name: git
type: registry-image
source:
aws_access_key_id: ((ecr_aws_key))
aws_secret_access_key: ((ecr_aws_secret))
repository: git-resource
aws_region: us-gov-west-1
tag: latest
- name: cf
type: registry-image
source:
aws_access_key_id: ((ecr_aws_key))
aws_secret_access_key: ((ecr_aws_secret))
repository: cf-resource
aws_region: us-gov-west-1
tag: latest
- name: registry-image
type: registry-image
source:
aws_access_key_id: ((ecr_aws_key))
aws_secret_access_key: ((ecr_aws_secret))
repository: registry-image-resource
aws_region: us-gov-west-1
tag: latest
- name: pull-request
type: registry-image
source:
aws_access_key_id: ((ecr_aws_key))
aws_secret_access_key: ((ecr_aws_secret))
repository: github-pr-resource
aws_region: us-gov-west-1
tag: latest