-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathgaffer.yml
305 lines (283 loc) · 8.1 KB
/
gaffer.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
resource_types:
- name: gcs
type: docker-image
source:
repository: frodenas/gcs-resource
- name: slack-notification
type: docker-image
source:
repository: cfcommunity/slack-notification-resource
tag: latest
- name: bosh-deployment
type: docker-image
source:
repository: cloudfoundry/bosh-deployment-resource
- name: bosh-errand
type: docker-image
source:
repository: pcfkubo/bosh2-errand-resource
tag: v0.1.3-dev
resources:
- name: gaffer-spec
type: git
source:
uri: https://github.com/cloudfoundry-incubator/kubo-ci
branch: master
paths: [ gaffer/gaffer.yml ]
- name: git-bosh-deployment
type: git
source:
uri: [email protected]:cloudfoundry/bosh-deployment.git
branch: master
private_key: ((git-ssh-key.private_key))
- name: git-kubo-deployment
type: git
source:
uri: [email protected]:cloudfoundry-incubator/kubo-deployment.git
branch: develop
private_key: ((git-ssh-key.private_key))
ignore_paths:
- 'LICENSE'
- 'NOTICE'
- name: git-kubo-ci
type: git
source:
uri: https://github.com/cloudfoundry-incubator/kubo-ci
branch: master
- name: gcs-bosh-state
type: gcs
source:
json_key: ((gcs-json-key))
bucket: kubo-pipeline-store
versioned_file: gaffer-env/state.json
- name: gcs-bosh-creds
type: gcs
source:
json_key: ((gcs-json-key))
bucket: kubo-pipeline-store
versioned_file: gaffer-env/creds.yml
- name: gcs-director.yml
type: gcs
source:
json_key: ((gcs-json-key))
bucket: kubo-pipeline-store
versioned_file: gaffer-env/metadata # Named so because locks are called metadata
- name: gcs-kubo-release-tarball
type: gcs
source:
json_key: ((gcs-json-key))
bucket: kubo-public
versioned_file: kubo-release-latest.tgz
- name: gcs-kubo-deployment-tarball
type: gcs
source:
json_key: ((gcs-json-key))
bucket: kubo-public
versioned_file: kubo-deployment-latest.tgz
- name: source-json
type: gcs
source:
json_key: ((gcs-json-key))
bucket: kubo-pipeline-store
versioned_file: gaffer-env/source.json
- name: gcs-load-balancer-vars
type: gcs
source:
json_key: ((gcs-json-key))
bucket: kubo-pipeline-store
versioned_file: load-balancer-vars.yml
- name: cfcr-deployment
type: bosh-deployment
source:
deployment: gaffer
skip_check: true
- name: slack-alert
type: slack-notification
source:
url: ((build-alert-slack-url))
- name: gcs-kubeconfig
type: gcs
source:
json_key: ((gcs-json-key))
bucket: kubo-pipeline-store
versioned_file: k8s/config
- name: run-apply-addons-errand
type: bosh-errand
source:
deployment: gaffer
skip_check: true
- name: run-smoke-tests-errand
type: bosh-errand
source:
deployment: gaffer
skip_check: true
jobs:
- name: deploy-bosh
plan:
- in_parallel:
- get: git-kubo-ci
- get: git-kubo-deployment
- get: git-bosh-deployment
- get: gcs-kubo-deployment-tarball
trigger: true
- get: gcs-kubo-release-tarball
trigger: true
- get: gcs-bosh-creds
- get: gcs-director.yml
- get: gcs-bosh-state
- task: unpack-kubo-deployment
file: git-kubo-ci/tasks/unpack-kubo-deployment.yml
input_mapping:
gcs-kubo-deployment-pre: gcs-kubo-deployment-tarball
on_failure: &on_failure_alert
do:
- put: slack-alert
params:
text: |
Updating gaffer failed <@cfcrteam>. https://ci.kubo.sh/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
- task: update-bosh
tags: [ gaffer ]
file: git-kubo-ci/tasks/update-bosh.yml
input_mapping: {kubo-lock: gcs-director.yml}
params:
GCP_SERVICE_ACCOUNT: ((gaffer-bosh-service-account))
CLOUD_CONFIG_OPS_FILES: git-kubo-ci/manifests/ops-files/add-ephemeral-ip-cloud-config.yml
on_failure: *on_failure_alert
- in_parallel:
- put: gcs-bosh-creds
params:
file: bosh-creds/creds.yml
- put: gcs-bosh-state
params:
file: bosh-state/state.json
- task: generate-load-balancer-vars
file: git-kubo-ci/tasks/generate-load-balancer-vars.yml
input_mapping: {kubo-lock: gcs-director.yml}
- task: generate-source-json
file: git-kubo-ci/tasks/generate-source-json.yml
input_mapping: {kubo-lock: gcs-director.yml}
- in_parallel:
- put: gcs-load-balancer-vars
params:
file: load-balancer-vars/vars.yml
- put: source-json
params:
file: source-json/source.json
- task: update-cloud-config-with-vm-ext
params:
DEPLOYMENT_NAME: gaffer
tags: [ 'gaffer' ]
file: git-kubo-ci/tasks/update-cloud-config-with-vm-ext.yml
input_mapping: {kubo-lock: gcs-director.yml}
- name: deploy-k8s
plan:
- in_parallel:
- get: git-kubo-ci
- get: gcs-kubo-deployment-tarball
passed: [ deploy-bosh ]
trigger: true
- get: gcs-kubo-release-tarball
passed: [ deploy-bosh ]
- get: gcs-bosh-creds
passed: [ deploy-bosh ]
- get: gcs-director.yml
passed: [ deploy-bosh ]
- get: source-json
passed: [ deploy-bosh ]
- get: gcs-load-balancer-vars
passed: [ deploy-bosh ]
- task: unpack-kubo-deployment
file: git-kubo-ci/tasks/unpack-kubo-deployment.yml
input_mapping:
gcs-kubo-deployment-pre: gcs-kubo-deployment-tarball
on_failure: *on_failure_alert
- task: upload-stemcell
tags: ['gaffer']
file: git-kubo-ci/tasks/upload-stemcell.yml
input_mapping:
gcs-source-json: source-json
params:
IAAS: gcp
- put: cfcr-deployment
params:
cleanup: true
manifest: git-kubo-deployment/manifests/cfcr.yml
ops_files:
- git-kubo-ci/manifests/ops-files/kubo-latest-version.yml
- git-kubo-deployment/manifests/ops-files/allow-privileged-containers.yml
- git-kubo-deployment/manifests/ops-files/iaas/gcp/cloud-provider.yml
- git-kubo-deployment/manifests/ops-files/use-vm-extensions.yml
- git-kubo-deployment/manifests/ops-files/misc/single-master.yml
- git-kubo-deployment/manifests/ops-files/add-hostname-to-master-certificate.yml
- git-kubo-ci/manifests/ops-files/scale-to-one-az.yml
- git-kubo-deployment/manifests/ops-files/rename.yml
- git-kubo-deployment/manifests/ops-files/vm-types.yml
releases:
- gcs-kubo-release-tarball/*.tgz
source_file: source-json/source.json
vars:
deployment_name: gaffer
worker_vm_type: worker
master_vm_type: master
apply_addons_vm_type: minimal
worker_count: 3
api-hostname: 35.201.123.45
vars_files:
- gcs-load-balancer-vars/load-balancer-vars.yml
- gcs-director.yml/metadata
tags: [gaffer]
on_failure: *on_failure_alert
on_success:
do:
- put: slack-alert
params:
text: |
Updating gaffer succeeded. https://ci.kubo.sh/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
- task: update-kubeconfig
tags: [gaffer]
file: git-kubo-ci/tasks/update-kubeconfig.yml
input_mapping: {kubo-lock: gcs-director.yml}
params:
DEPLOYMENT_NAME: gaffer
- put: run-apply-addons-errand
params:
name: apply-addons
keep_alive: true
source_file: source-json/source.json
tags: [gaffer]
on_failure: *on_failure_alert
- put: run-smoke-tests-errand
params:
name: smoke-tests
keep_alive: true
source_file: source-json/source.json
tags: [gaffer]
on_failure: *on_failure_alert
- in_parallel:
- put: gcs-kubeconfig
params:
file: kubeconfig/config
- name: deploy-gaffer
plan:
- get: git-kubo-ci
resource: gaffer-spec
trigger: true
- get: gcs-kubeconfig
passed: [ "deploy-k8s" ]
- task: upgrade-gaffer
config:
platform: linux
inputs:
- name: git-kubo-ci
- name: gcs-kubeconfig
run:
path: sh
args:
- -ec
- KUBECONFIG="$PWD/gcs-kubeconfig/config" kubectl apply -f git-kubo-ci/gaffer/gaffer.yml
image_resource:
type: docker-image
source:
repository: pcfkubo/kubectl
tag: stable
on_failure: *on_failure_alert