forked from cloud-gov/uaa-credentials-broker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipeline.yml
218 lines (208 loc) · 7.45 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
---
jobs:
- name: test-broker
plan:
- get: broker-src
trigger: true
- task: run-tests
file: broker-src/run-tests.yml
- name: push-broker-staging
serial_groups: [staging]
serial: true
plan:
- aggregate:
- get: broker-src
passed: [test-broker]
trigger: true
- 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.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-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-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
- task: acceptance-tests-staging
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:
- aggregate:
- 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.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.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_BLACKLIST: {{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-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-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
- task: acceptance-tests-production
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: {{broker-git-url}}
branch: {{broker-git-branch}}
- name: pipeline-tasks
type: git
source:
uri: {{pipeline-tasks-git-url}}
branch: {{pipeline-tasks-git-branch}}
- 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}}
resource_types:
- name: slack-notification
type: docker-image
source:
repository: cfcommunity/slack-notification-resource