Skip to content

Commit caf2c83

Browse files
committed
CI: use consistent bot account
- set bot details as YAML anchors - pass bot details from pipeline => tasks
1 parent dc1d5b3 commit caf2c83

12 files changed

Lines changed: 73 additions & 35 deletions

ci/pipelines/builder.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#@ load("@ytt:data", "data")
22
#@yaml/text-templated-strings
3+
anchors:
4+
ci_bot:
5+
email: &ci_bot_email bots@cloudfoundry.org
6+
name: &ci_bot_name CI Bot
37

48
groups:
59
- name: build
@@ -256,9 +260,9 @@ jobs:
256260
- usn-log/usn-log.json
257261
rename: (@= data.values.stemcell_details.branch @)/(@= data.values.stemcell_details.os_name @).meta4
258262
options:
259-
author_email: ci@localhost
260-
author_name: CI Bot
261-
message: '[ci skip] bump OS image'
263+
author_email: *ci_bot_email
264+
author_name: *ci_bot_name
265+
message: 'Bump os-image tgz'
262266
version: version/version
263267
- put: os-image-version
264268
params:
@@ -493,8 +497,8 @@ jobs:
493497
- stemcell/*.tgz
494498
rename: "{{.Version}}/(@= IAAS @)-(@= HYPERVISOR @)(@= FIPS @)-go_agent.meta4"
495499
options:
496-
author_email: ci@localhost
497-
author_name: CI Bot
500+
author_email: *ci_bot_email
501+
author_name: *ci_bot_name
498502
message: 'dev: (@= data.values.stemcell_details.os_name @)'
499503
version: candidate-build-number/number
500504
#@ end
@@ -627,7 +631,10 @@ jobs:
627631
- task: commit-build-time
628632
file: bosh-stemcells-ci/ci/tasks/commit-build-time.yml
629633
image: os-image-stemcell-builder-registry-image
630-
#@ if len(data.values.stemcell_details.include_fips_iaas) > 0:
634+
params:
635+
GIT_USER_EMAIL: *ci_bot_email
636+
GIT_USER_NAME: *ci_bot_name
637+
#@ if len(data.values.stemcell_details.include_fips_iaas) > 0:
631638
- task: copy-fips-artifacts
632639
file: bosh-stemcells-ci/ci/tasks/publish.yml
633640
image: bosh-integration-image
@@ -647,7 +654,9 @@ jobs:
647654
TO_INDEX: candidate
648655
AWS_ENDPOINT: "https://storage.googleapis.com"
649656
S3_API_ENDPOINT: storage.googleapis.com
650-
#@ end
657+
GIT_USER_EMAIL: *ci_bot_email
658+
GIT_USER_NAME: *ci_bot_name
659+
#@ end
651660
- task: copy-artifacts
652661
file: bosh-stemcells-ci/ci/tasks/publish.yml
653662
image: bosh-integration-image
@@ -667,6 +676,8 @@ jobs:
667676
TO_INDEX: candidate
668677
AWS_ENDPOINT: "https://storage.googleapis.com"
669678
S3_API_ENDPOINT: storage.googleapis.com
679+
GIT_USER_EMAIL: *ci_bot_email
680+
GIT_USER_NAME: *ci_bot_name
670681
- in_parallel:
671682
- put: bosh-linux-stemcell-builder-push-tags
672683
no_get: true
@@ -753,8 +764,8 @@ jobs:
753764
output_mapping:
754765
output-repo: bosh-linux-stemcell-builder
755766
params:
756-
GIT_USER_NAME: CI Bot
757-
GIT_USER_EMAIL: bots@cloudfoundry.org
767+
GIT_USER_EMAIL: *ci_bot_email
768+
GIT_USER_NAME: *ci_bot_name
758769
PACKAGE: ruby-((.:ruby_version))
759770
VENDOR: true
760771
- task: test-unit
@@ -817,6 +828,9 @@ jobs:
817828
- task: bump
818829
file: bosh-stemcells-ci/ci/tasks/bump-bosh-agent.yml
819830
image: bosh-integration-image
831+
params:
832+
GIT_USER_EMAIL: *ci_bot_email
833+
GIT_USER_NAME: *ci_bot_name
820834
- put: bosh-linux-stemcell-builder-push
821835
params:
822836
rebase: true
@@ -837,6 +851,8 @@ jobs:
837851
image: bosh-integration-image
838852
params:
839853
BLOBSTORE_TYPE: (@= blobstore_type @)
854+
GIT_USER_EMAIL: *ci_bot_email
855+
GIT_USER_NAME: *ci_bot_name
840856
- put: bosh-linux-stemcell-builder-push
841857
params:
842858
rebase: true

ci/pipelines/publisher.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#@ load("@ytt:data", "data")
2+
anchors:
3+
ci_bot:
4+
email: &ci_bot_email bots@cloudfoundry.org
5+
name: &ci_bot_name CI Bot
26

37
#@ def build_light_aws_stemcell_new(name, stemcell_os, stemcell_version, builder_src, input_stemcell, output_stemcell, prefix, region, bucket_prefix, tag, ami_destinations, efi, ami_excluded_destinations):
48
do:
@@ -379,8 +383,8 @@ jobs:
379383
files:
380384
- light-stemcell/*.tgz
381385
options:
382-
author_email: ci@localhost
383-
author_name: CI Bot
386+
author_email: *ci_bot_email
387+
author_name: *ci_bot_name
384388
message: 'candidate (light aws): (@= data.values.stemcell_details.os_name @)/(@= str(data.values.stemcell_details.major_version) @).x'
385389
version: us-input-stemcell/.resource/version
386390
put: candidate-aws-light-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)
@@ -416,8 +420,8 @@ jobs:
416420
files:
417421
- light-stemcell/*.tgz
418422
options:
419-
author_email: ci@localhost
420-
author_name: CI Bot
423+
author_email: *ci_bot_email
424+
author_name: *ci_bot_name
421425
message: 'candidate (light google): (@= data.values.stemcell_details.os_name @)/(@= str(data.values.stemcell_details.major_version) @).x'
422426
version: stemcell/.resource/version
423427
put: candidate-google-light-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)
@@ -487,8 +491,8 @@ jobs:
487491
files:
488492
- candidate-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)/*.tgz
489493
options:
490-
author_email: ci@localhost
491-
author_name: CI Bot
494+
author_email: *ci_bot_email
495+
author_name: *ci_bot_name
492496
message: 'publish (heavy): (@= data.values.stemcell_details.os_name @)/(@= str(data.values.stemcell_details.major_version) @).x'
493497
rename: '{{.Version}}/stemcells.meta4'
494498
version: candidate-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)/.resource/version
@@ -498,8 +502,8 @@ jobs:
498502
files:
499503
- candidate-(@= data.values.stemcell_details.os_name @)-fips-stemcell-(@= str(data.values.stemcell_details.major_version) @)/*.tgz
500504
options:
501-
author_email: ci@localhost
502-
author_name: CI Bot
505+
author_email: *ci_bot_email
506+
author_name: *ci_bot_name
503507
message: 'publish (heavy): (@= data.values.stemcell_details.os_name @)-fips/(@= str(data.values.stemcell_details.major_version) @).x'
504508
rename: '{{.Version}}/stemcells.meta4'
505509
version: candidate-(@= data.values.stemcell_details.os_name @)-fips-stemcell-(@= str(data.values.stemcell_details.major_version) @)/.resource/version
@@ -508,8 +512,8 @@ jobs:
508512
files:
509513
- candidate-aws-light-stemcell/*.tgz
510514
options:
511-
author_email: ci@localhost
512-
author_name: CI Bot
515+
author_email: *ci_bot_email
516+
author_name: *ci_bot_name
513517
message: 'publish (light aws): (@= data.values.stemcell_details.os_name @)/(@= str(data.values.stemcell_details.major_version) @).x'
514518
rename: '{{.Version}}/stemcells.aws.meta4'
515519
version: candidate-aws-light-stemcell/.resource/version
@@ -542,8 +546,8 @@ jobs:
542546
files:
543547
- candidate-google-light-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)/*.tgz
544548
options:
545-
author_email: ci@localhost
546-
author_name: CI Bot
549+
author_email: *ci_bot_email
550+
author_name: *ci_bot_name
547551
message: 'publish (light google): (@= data.values.stemcell_details.os_name @)/(@= str(data.values.stemcell_details.major_version) @).x'
548552
rename: '{{.Version}}/stemcells.gcp.meta4'
549553
version: candidate-google-light-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)/.resource/version

ci/tasks/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,6 @@ cat "$meta4_path"
135135
cd "${REPO_PARENT}/stemcells-index-output"
136136

137137
git add -A
138-
git config --global user.email "ci@localhost"
139-
git config --global user.name "CI Bot"
138+
git config --global user.email "${GIT_USER_EMAIL}"
139+
git config --global user.name "${GIT_USER_NAME}"
140140
git commit -m "dev: ${OS_NAME}-${OS_VERSION}/${CANDIDATE_BUILD_NUMBER} ($IAAS-$HYPERVISOR)"

ci/tasks/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ params:
2828
S3_API_ENDPOINT: s3.amazonaws.com
2929
ESM_TOKEN:
3030
AGENT_SUFFIX: -go_agent
31+
GIT_USER_EMAIL:
32+
GIT_USER_NAME:

ci/tasks/bump-bosh-agent.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ cp "${REPO_PARENT}/bosh-agent/.resource/version" \
2323
pushd "${REPO_PARENT}/bosh-linux-stemcell-builder-out"
2424
if [ "$(git status --porcelain)" != "" ]; then
2525
git add -A
26-
git config --global user.email "ci@localhost"
27-
git config --global user.name "CI Bot"
26+
git config --global user.email "${GIT_USER_EMAIL}"
27+
git config --global user.name "${GIT_USER_NAME}"
2828
git commit -m "bump bosh-agent/$version"
2929
fi
3030
popd

ci/tasks/bump-bosh-agent.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ outputs:
1313

1414
run:
1515
path: bosh-stemcells-ci/ci/tasks/bump-bosh-agent.sh
16+
17+
params:
18+
GIT_USER_EMAIL:
19+
GIT_USER_NAME:

ci/tasks/bump-bosh-blobstore-cli.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ echo "${sha256sum}" > \
2626
pushd "${REPO_PARENT}/bosh-linux-stemcell-builder-out"
2727
if [ "$(git status --porcelain)" != "" ]; then
2828
git add -A
29-
git config --global user.email "ci@localhost"
30-
git config --global user.name "CI Bot"
29+
git config --global user.email "${GIT_USER_EMAIL}"
30+
git config --global user.name "${GIT_USER_NAME}"
3131
git commit -m "bump bosh-blobstore-${BLOBSTORE_TYPE}/${version}"
3232
fi
3333
popd

ci/tasks/bump-bosh-blobstore-cli.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ outputs:
1313

1414
run:
1515
path: bosh-stemcells-ci/ci/tasks/bump-bosh-blobstore-cli.sh
16+
17+
params:
18+
GIT_USER_EMAIL:
19+
GIT_USER_NAME:

ci/tasks/commit-build-time.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ formatted_build_time="$(date --date "${build_time%.*}" +%Y%m%dT%H%M%SZ)"
1616
pushd "${REPO_PARENT}/bosh-linux-stemcell-builder"
1717
echo "${formatted_build_time}" > build_time.txt
1818
git add -A
19-
git config --global user.email "ci@localhost"
20-
git config --global user.name "CI Bot"
19+
git config --global user.email "${GIT_USER_EMAIL}"
20+
git config --global user.name "${GIT_USER_NAME}"
2121
git commit -m "Commit Build Time"
2222
popd

ci/tasks/commit-build-time.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ outputs:
1111

1212
run:
1313
path: bosh-stemcells-ci/ci/tasks/commit-build-time.sh
14+
15+
params:
16+
GIT_USER_EMAIL:
17+
GIT_USER_NAME:

0 commit comments

Comments
 (0)