-
Notifications
You must be signed in to change notification settings - Fork 38
/
buildpack.yml.erb
614 lines (585 loc) · 19.2 KB
/
buildpack.yml.erb
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
<% buildpacks = {
'apt' => {
'stacks' => %w(cflinuxfs3 cflinuxfs4)
},
'binary' => {
'stacks' => %w(cflinuxfs3 cflinuxfs4 windows),
'product_slug' => 'binary-buildpack',
'skip_docker_start' => true,
},
'dotnet-core' => {
'stacks' => %w(cflinuxfs3 cflinuxfs4),
'product_slug' => 'dotnet-core-buildpack',
'compute_instance_count' => 3
},
'go' => {
'stacks' => %w(cflinuxfs3 cflinuxfs4),
'product_slug' => 'go-buildpack',
'compute_instance_count' => 3
},
'hwc' => {
'stacks' => %w(windows),
'skip_brats' => true,
'product_slug' => 'hwc-buildpack'
},
'nginx' => {
'stacks' => %w(cflinuxfs3 cflinuxfs4),
'product_slug' => 'nginx-buildpack',
},
'nodejs' => {
'stacks' => %w(cflinuxfs3 cflinuxfs4),
'product_slug' => 'nodejs-buildpack',
},
'php' => {
'stacks' => %w(cflinuxfs3 cflinuxfs4),
'product_slug' => 'php-buildpack',
'compile_extensions' => true,
},
'python' => {
'stacks' => %w(cflinuxfs3 cflinuxfs4),
'product_slug' => 'python-buildpack',
},
'r' => {
'stacks' => %w(cflinuxfs3 cflinuxfs4),
'product_slug' => 'r-buildpack',
'skip_brats' => true,
'skip_docker_start' => true,
},
'ruby' => {
'stacks' => %w(cflinuxfs3 cflinuxfs4),
'product_slug' => 'ruby-buildpack',
'compute_instance_count' => 3
},
'staticfile' => {
'stacks' => %w(cflinuxfs3 cflinuxfs4),
'product_slug' => 'staticfile-buildpack',
}
} %>
---
resource_types:
- name: cron
type: docker-image
source:
repository: cfbuildpacks/cron-resource
- name: shepherd
type: registry-image
source:
repository: us-west2-docker.pkg.dev/shepherd-268822/shepherd2/concourse-resource
tag: v1
- name: pool
type: registry-image
source:
repository: concourse/pool-resource
tag: 1.1.3
resources: ############################################################################################################
## Git ##
- name: buildpack-develop
type: git
webhook_token: ob0aigh3
source:
uri: git@github.com:<%= organization %>/<%= language %>-buildpack.git
private_key: ((cloudfoundry-<%= language %>-buildpack-deploy-key.private_key))
branch: develop
ignore_paths:
- VERSION
- CHANGELOG
- name: cf-deployment
type: git
source:
uri: https://github.com/cloudfoundry/cf-deployment
- name: buildpack-new-version
type: git
source:
uri: git@github.com:<%= organization %>/<%= language %>-buildpack.git
private_key: ((cloudfoundry-<%= language %>-buildpack-deploy-key.private_key))
branch: develop
paths:
- VERSION
- CHANGELOG
- name: buildpack-master
type: git
source:
uri: git@github.com:<%= organization %>/<%= language %>-buildpack.git
private_key: ((cloudfoundry-<%= language %>-buildpack-deploy-key.private_key))
branch: master
- name: buildpacks-ci
type: git
source:
uri: https://github.com/cloudfoundry/buildpacks-ci
branch: master
- name: libbuildpack
type: git
webhook_token: ob0aigh3
source:
uri: https://github.com/cloudfoundry/libbuildpack.git
<% if buildpacks[language]['compile_extensions'] %>
- name: compile-extensions
type: git
source:
uri: https://github.com/cloudfoundry/compile-extensions.git
<% end %>
<% if language == 'hwc' %>
- name: buildpack-bosh-release
type: git
source:
uri: git@github.com:<%= organization %>/<%= language %>-buildpack-release.git
private_key: ((cloudfoundry-<%= language %>-buildpack-bosh-release-deploy-key.private_key))
branch: master
<% end %>
- name: env-repo
type: git
source:
uri: git@github.com:cloudfoundry/buildpacks-envs
branch: master
private_key: '((cloudfoundry-buildpacks-envs-deploy-key.private_key))'
## Github Releases ##
- name: buildpack-github-release
type: github-release
source:
user: {{buildpacks-github-org}}
repository: <%= language %>-buildpack
access_token: ((buildpacks-github-token))
<% if language == 'hwc' %>
- name: buildpack-bosh-release-github-release
type: github-release
source:
user: {{buildpacks-github-org}}
repository: <%= language %>-buildpack-release
access_token: ((buildpacks-github-token))
<% end %>
<% if buildpacks[language]['compile_extensions'] %>
- name: buildpack-packager
type: github-release
source:
user: {{buildpacks-github-org}}
repository: buildpack-packager
access_token: ((buildpacks-github-token))
<% end %>
## S3 Buckets ##
<% buildpacks[language]['stacks'].each do |stack| %>
- name: pivotal-buildpack-<%= stack %>
type: s3
source:
bucket: {{buildpack-release-candidates-bucket}}
regexp: <%= language%>/<%= language %>_buildpack-<%= stack %>-v(.*).zip
access_key_id: ((svc-buildpacks-aws-bp-ci-access-key))
secret_access_key: ((svc-buildpacks-aws-bp-ci-secret-key))
aws_role_arn: ((svc-buildpacks-aws-bp-ci-assume-role-arn))
- name: pivotal-buildpack-cached-<%= stack %>
type: s3
source:
bucket: {{buildpack-release-candidates-bucket}}
regexp: <%= language%>/<%= language %>_buildpack-cached-<%= stack %>-v(.*).zip
access_key_id: ((svc-buildpacks-aws-bp-ci-access-key))
secret_access_key: ((svc-buildpacks-aws-bp-ci-secret-key))
aws_role_arn: ((svc-buildpacks-aws-bp-ci-assume-role-arn))
<% end %>
<% if language.to_s == 'hwc' || language.to_s == 'binary' %>
- name: pivotal-buildpack-cached-any
type: s3
source:
bucket: {{buildpack-release-candidates-bucket}}
regexp: <%= language%>/<%= language %>_buildpack-cached-v(.*).zip
access_key_id: ((svc-buildpacks-aws-bp-ci-access-key))
secret_access_key: ((svc-buildpacks-aws-bp-ci-secret-key))
aws_role_arn: ((svc-buildpacks-aws-bp-ci-assume-role-arn))
- name: pivotal-buildpack-any
type: s3
source:
bucket: {{buildpack-release-candidates-bucket}}
regexp: <%= language%>/<%= language %>_buildpack-v(.*).zip
access_key_id: ((svc-buildpacks-aws-bp-ci-access-key))
secret_access_key: ((svc-buildpacks-aws-bp-ci-secret-key))
aws_role_arn: ((svc-buildpacks-aws-bp-ci-assume-role-arn))
<% end %>
## Resource Pools ##
- name: shepherd-cf-environment
type: shepherd
source:
url: https://v2.shepherd.run
service-account-key: ((shepherd-buildpacks-service-account-key))
lease:
namespace: buildpacks
pool:
namespace: official
name: cfd
compatibility-mode: environments-app
jobs: ################################################################################################################
<% if language == "php" %>
- name: ensure-manifest-has-modules
serial: true
public: true
plan:
- in_parallel:
- get: buildpacks-ci
- get: buildpack
resource: buildpack-develop
trigger: true
- do:
- task: check-modules
file: buildpacks-ci/tasks/check-php-modules-in-manifest/task.yml
<% end %>
- name: specs-unit-develop
serial: true
public: true
plan:
- do:
- in_parallel:
- get: buildpacks-ci
- get: buildpack
resource: buildpack-develop
<% if language == "php" %>
passed: [ ensure-manifest-has-modules ]
<% end %>
trigger: true
- do:
- task: ginkgo
file: buildpacks-ci/tasks/run-buildpack-unit-specs/task.yml
<% if language == "php" %>
privileged: true
params:
DOCKER_START: true
<% end %>
- name: detect-new-version-and-upload-artifacts
serial: true
public: true
plan:
- in_parallel:
- get: buildpacks-ci
- get: buildpack
resource: buildpack-master
trigger: true
<% bucket_stacks = buildpacks[language]['stacks']
bucket_stacks = bucket_stacks + ['any'] if language.to_s == 'hwc' || language.to_s == 'binary'
bucket_stacks.each do |stack| %> #change bucket_stacks to buildpacks[language]['stacks'] when removing any_stack
- get: pivotal-buildpack-cached-<%= stack %>
- get: pivotal-buildpack-<%= stack %>
<% end %>
- do:
- in_parallel:
<% bucket_stacks = buildpacks[language]['stacks']
bucket_stacks = bucket_stacks + ['any'] if language.to_s == 'hwc' || language.to_s == 'binary'
bucket_stacks.each do |stack| %> #change bucket_stacks to buildpacks[language]['stacks'] when removing any_stack
- do:
- task: detect-and-upload-<%= stack %>
file: buildpacks-ci/tasks/detect-and-upload/task.yml
params:
GIT_REPO_ORG: <%= organization %>
BUILDPACK_NAME: <%= language %>-buildpack
RUBYGEM_MIRROR: {{rubygem-mirror}}
CF_STACK: <%= stack %>
input_mapping:
pivotal-buildpack: pivotal-buildpack-<%= stack %>
pivotal-buildpack-cached: pivotal-buildpack-cached-<%= stack %>
output_mapping:
buildpack-artifacts: buildpack-artifacts-<%= stack %>
- put: pivotal-buildpack-<%= stack %>
params:
file: buildpack-artifacts-<%= stack %>/uncached/*_buildpack*-v*.zip
- put: pivotal-buildpack-cached-<%= stack %>
params:
file: buildpack-artifacts-<%= stack %>/cached/*_buildpack-cached*-v*.zip
<% end %>
- name: ship-it
serial: true
public: true
plan:
- in_parallel:
- get: buildpacks-ci
<%
all_stacks = buildpacks[language]['stacks']
all_stacks = all_stacks + ['any'] if language.to_s == 'hwc' || language.to_s == 'binary'
all_stacks.each_with_index do |stack, ndx|
%>
- get: pivotal-buildpack-cached-<%= stack %>
passed:
- detect-new-version-and-upload-artifacts
- get: pivotal-buildpack-<%= stack %>
passed:
- detect-new-version-and-upload-artifacts
<% end %>
- get: buildpack
passed:
- detect-new-version-and-upload-artifacts
resource: buildpack-master
- task: check-tag-not-already-added
file: buildpacks-ci/tasks/check-tag-not-already-added/task.yml
- put: buildpack-master
params:
repository: buildpack
tag: buildpack/VERSION
tag_prefix: v
- name: buildpack-to-github
serial: true
public: true
plan:
- in_parallel:
- get: buildpacks-ci
<% buildpacks[language]['stacks'].each_with_index do |stack, ndx| %>
- get: uncached-buildpack-for-stack<%= ndx.to_s %>
resource: pivotal-buildpack-<%= stack %>
passed: [ ship-it ]
<% end %>
- get: buildpack
resource: buildpack-master
passed: [ ship-it ]
trigger: true
- task: finalize-buildpack
file: buildpacks-ci/tasks/finalize-buildpack/task.yml
- put: buildpack-github-release
params:
name: buildpack-artifacts/tag
tag: buildpack-artifacts/tag
body: buildpack-artifacts/RECENT_CHANGES
globs:
- buildpack-artifacts/*-buildpack*-v*.zip
- buildpack-artifacts/*-buildpack*-v*.zip.SHA256SUM.txt
<% relevant_stacks = buildpacks[language]['stacks'] %>
<% relevant_stacks.each do |stack| %>
- name: specs-edge-integration-develop-<%= stack %>
serial: true
public: true
plan:
- in_parallel:
- put: environment
resource: shepherd-cf-environment
params:
action: create
duration: 6h
resource: shepherd-cf-environment
description: |
Running <%= language %>-buildpack specs-edge-integration-develop-<%= stack %> job.
timeout: 6h
- get: buildpacks-ci
- get: env-repo
- get: buildpack
resource: buildpack-develop
trigger: true
passed:
- specs-unit-develop
- get: repo
resource: buildpack-develop
- get: cf-deployment
- task: redeploy
file: buildpacks-ci/tasks/cf/redeploy/task.yml
input_mapping:
ci: buildpacks-ci
lock: environment
params:
SCALE_DIEGO_CELLS: true
<% if stack == "cflinuxfs3" %>
ADD_CFLINUXFS3_STACK: true
<% end %>
<% if buildpacks[language]['stacks'].include?('windows')%>
DEPLOY_WINDOWS_CELL: true
<% end %>
- do:
- task: create-cf-space
attempts: 5
file: buildpacks-ci/tasks/cf/create-space/task.yml
input_mapping:
ci: buildpacks-ci
lock: environment
params:
DOMAIN: 'cf-app.com'
ORG: pivotal
<% unless buildpacks[language]['skip_brats'] %>
<% if buildpacks[language]['stacks'].include?('cflinuxfs4')%>
- task: configure-brats-test-config
config:
platform: linux
image_resource:
type: docker-image
source:
repository: cfbuildpacks/ci
inputs:
- name: buildpack
outputs:
- name: buildpack
run:
dir: ""
path: bash
args:
- -c
- |
#!/bin/bash
set -e
cd buildpack
contents="$(jq '.stack = "<%= stack %>"' config.json)"
echo -E "${contents}" > config.json
echo -e "config.json modified to:\n $(cat config.json)"
<% end %>
- task: brats-<%= stack %>
file: buildpacks-ci/tasks/<%= language.to_s == 'php' ? 'run-bp-brats-jammy' : 'run-bp-brats' %>/task.yml
input_mapping: {cf-space: space}
attempts: 5
params:
CF_STACK: <%= stack %>
GINKGO_ATTEMPTS: 4
GINKGO_NODES: 3
<% end %>
- task: integration-test-<%= stack %>
file: buildpacks-ci/tasks/run-buildpack-integration-specs/task.yml
input_mapping: {cf-space: space}
params:
CF_STACK: <%= stack %>
GINKGO_ATTEMPTS: 4
GINKGO_NODES: 3
<% if language == 'php' %>
COMPOSER_GITHUB_OAUTH_TOKEN: '((composer-github-oauth-token))'
<% end %>
<% if buildpacks[language]['skip_docker_start'] %>
SKIP_DOCKER_START: true
<% else %>
privileged: true
<% end %>
ensure:
task: delete-cf-space
file: buildpacks-ci/tasks/delete-cf-space/task.yml
input_mapping: {cf-space: space}
on_success:
put: environment
resource: shepherd-cf-environment
params:
action: release
resource: environment
<% end %>
- name: specs-edge-shared-develop
serial: true
public: true
plan:
- do:
- get: buildpacks-ci
- get: repo
resource: buildpack-develop
trigger: true
passed:
<% relevant_stacks = buildpacks[language]['stacks'] %>
<% relevant_stacks.each do |stack| %>
- specs-edge-integration-develop-<%= stack %>
<% end %>
on_success:
task: github-set-status-success
file: buildpacks-ci/tasks/set-status-success/task.yml
params:
GITHUB_ACCESS_TOKEN: ((buildpacks-github-token))
GITHUB_REPO: <%= organization %>/<%= language %>-buildpack
GITHUB_STATUS_CONTEXT: 'buildpacks-ci/edge-develop'
GITHUB_STATUS_DESCRIPTION: 'Buildpacks CI edge develop spec passed'
PIPELINE_URI: {{buildpacks-ci-pipeline-uri}}
- name: buildpack-to-master
serial: true
public: true
plan:
- in_parallel:
- get: buildpacks-ci
- get: repo
trigger: true
resource: buildpack-new-version
- task: merge-to-master
file: buildpacks-ci/tasks/buildpack-to-master/task.yml
params:
GITHUB_ACCESS_TOKEN: ((buildpacks-github-token))
GITHUB_REPO: <%= organization %>/<%= language %>-buildpack
GITHUB_STATUS_CONTEXT: 'buildpacks-ci/passed-dev-specs'
GITHUB_STATUS_DESCRIPTION: 'Buildpacks CI develop specs passed'
PIPELINE_URI: {{buildpacks-ci-pipeline-uri}}
- name: update-libbuildpack
serial: true
public: true
plan:
- in_parallel:
- get: buildpacks-ci
- get: libbuildpack
trigger: true
- get: buildpack
resource: buildpack-develop
- task: update-libbuildpack
file: buildpacks-ci/tasks/update-libbuildpack/task.yml
<% if language == "php" %>
privileged: true
<% end %>
params:
<% if language == 'php' %>
DOCKER_START: true
<% end %>
LANGUAGE: <%= language %>
- put: buildpack-develop
params:
repository: buildpack
rebase: true
<% if buildpacks[language]['compile_extensions'] %>
- name: update-compile-extensions
serial: true
public: true
plan:
- in_parallel:
- get: buildpacks-ci
- get: compile-extensions
trigger: true
- get: buildpack
resource: buildpack-develop
- task: update-compile-extensions
file: buildpacks-ci/tasks/update-compile-extensions/task.yml
params: { RUBYGEM_MIRROR: {{rubygem-mirror}} }
- put: buildpack-develop
params:
repository: buildpack-artifacts
rebase: true
- name: update-buildpack-packager
serial: true
public: true
plan:
- in_parallel:
- get: buildpacks-ci
- get: gem
resource: buildpack-packager
trigger: true
- get: repo-with-gemfile
resource: buildpack-develop
- task: update-buildpack-packager
file: buildpacks-ci/tasks/update-gem-in-gemfile/task.yml
params:
RUBYGEM_MIRROR: {{rubygem-mirror}}
GEM_NAME: buildpack-packager
GEM_GIT_REPOSITORY: {{buildpack-packager-git-uri-public}}
GEMFILE_NAME: cf.Gemfile
- put: buildpack-develop
params:
repository: repo-with-gemfile-artifacts
rebase: true
<% end %>
<% if language == 'hwc' %>
- name: update-buildpack-bosh-release
serial: true
public: true
plan:
- in_parallel:
- get: buildpacks-ci
- get: release
resource: buildpack-bosh-release
<% buildpacks[language]['stacks'].each_with_index do |stack, i| %>
- get: buildpack-zip-stack<%= i %>
resource: pivotal-buildpack-<%= stack %>
trigger: true
passed: [ ship-it ]
<% end %>
- do:
- task: create-bosh-release
file: buildpacks-ci/tasks/create-bosh-release/task.yml
params:
ACCESS_KEY_ID: ((buildpacks-cloudfoundry-org-aws-access-key-id))
SECRET_ACCESS_KEY: ((buildpacks-cloudfoundry-org-aws-secret-access-key))
LANGUAGE: "hwc"
RELEASE_NAME: hwc-buildpack
RELEASE_DIR: release
- put: buildpack-bosh-release
params:
repository: release-artifacts
rebase: true
tag: version/version
- put: buildpack-bosh-release-github-release
params:
name: version/version
tag: version/version
<% end %>