Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 27 additions & 9 deletions ci/pipelines/builder.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
anchors:
ci_bot:
email: &ci_bot_email bots@cloudfoundry.org
name: &ci_bot_name CI Bot

#@ load("@ytt:data", "data")

#@yaml/text-templated-strings

groups:
Expand Down Expand Up @@ -256,9 +262,9 @@ jobs:
- usn-log/usn-log.json
rename: (@= data.values.stemcell_details.branch @)/(@= data.values.stemcell_details.os_name @).meta4
options:
author_email: ci@localhost
author_name: CI Bot
message: '[ci skip] bump OS image'
author_email: *ci_bot_email
author_name: *ci_bot_name
message: 'Bump os-image tgz'
version: version/version
- put: os-image-version
params:
Expand Down Expand Up @@ -493,8 +499,8 @@ jobs:
- stemcell/*.tgz
rename: "{{.Version}}/(@= IAAS @)-(@= HYPERVISOR @)(@= FIPS @).meta4"
options:
author_email: ci@localhost
author_name: CI Bot
author_email: *ci_bot_email
author_name: *ci_bot_name
message: 'dev: (@= data.values.stemcell_details.os_name @)'
version: candidate-build-number/number
#@ end
Expand Down Expand Up @@ -627,7 +633,10 @@ jobs:
- task: commit-build-time
file: bosh-stemcells-ci/ci/tasks/commit-build-time.yml
image: os-image-stemcell-builder-registry-image
#@ if len(data.values.stemcell_details.include_fips_iaas) > 0:
params:
GIT_USER_EMAIL: *ci_bot_email
GIT_USER_NAME: *ci_bot_name
#@ if len(data.values.stemcell_details.include_fips_iaas) > 0:
- task: copy-fips-artifacts
file: bosh-stemcells-ci/ci/tasks/publish.yml
image: bosh-integration-image
Expand All @@ -647,7 +656,9 @@ jobs:
TO_INDEX: candidate
AWS_ENDPOINT: "https://storage.googleapis.com"
S3_API_ENDPOINT: storage.googleapis.com
#@ end
GIT_USER_EMAIL: *ci_bot_email
GIT_USER_NAME: *ci_bot_name
#@ end
- task: copy-artifacts
file: bosh-stemcells-ci/ci/tasks/publish.yml
image: bosh-integration-image
Expand All @@ -667,6 +678,8 @@ jobs:
TO_INDEX: candidate
AWS_ENDPOINT: "https://storage.googleapis.com"
S3_API_ENDPOINT: storage.googleapis.com
GIT_USER_EMAIL: *ci_bot_email
GIT_USER_NAME: *ci_bot_name
- in_parallel:
- put: bosh-linux-stemcell-builder-push-tags
no_get: true
Expand Down Expand Up @@ -753,8 +766,8 @@ jobs:
output_mapping:
output-repo: bosh-linux-stemcell-builder
params:
GIT_USER_NAME: CI Bot
GIT_USER_EMAIL: bots@cloudfoundry.org
GIT_USER_EMAIL: *ci_bot_email
GIT_USER_NAME: *ci_bot_name
PACKAGE: ruby-((.:ruby_version))
VENDOR: true
- task: test-unit
Expand Down Expand Up @@ -817,6 +830,9 @@ jobs:
- task: bump
file: bosh-stemcells-ci/ci/tasks/bump-bosh-agent.yml
image: bosh-integration-image
params:
GIT_USER_EMAIL: *ci_bot_email
GIT_USER_NAME: *ci_bot_name
- put: bosh-linux-stemcell-builder-push
params:
rebase: true
Expand All @@ -837,6 +853,8 @@ jobs:
image: bosh-integration-image
params:
BLOBSTORE_TYPE: (@= blobstore_type @)
GIT_USER_EMAIL: *ci_bot_email
GIT_USER_NAME: *ci_bot_name
- put: bosh-linux-stemcell-builder-push
params:
rebase: true
Expand Down
29 changes: 17 additions & 12 deletions ci/pipelines/publisher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ ensure:

#@yaml/text-templated-strings
---
anchors:
ci_bot:
email: &ci_bot_email bots@cloudfoundry.org
name: &ci_bot_name CI Bot

groups:
- name: all
jobs:
Expand Down Expand Up @@ -379,8 +384,8 @@ jobs:
files:
- light-stemcell/*.tgz
options:
author_email: ci@localhost
author_name: CI Bot
author_email: *ci_bot_email
author_name: *ci_bot_name
message: 'candidate (light aws): (@= data.values.stemcell_details.os_name @)/(@= str(data.values.stemcell_details.major_version) @).x'
version: us-input-stemcell/.resource/version
put: candidate-aws-light-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)
Expand Down Expand Up @@ -416,8 +421,8 @@ jobs:
files:
- light-stemcell/*.tgz
options:
author_email: ci@localhost
author_name: CI Bot
author_email: *ci_bot_email
author_name: *ci_bot_name
message: 'candidate (light google): (@= data.values.stemcell_details.os_name @)/(@= str(data.values.stemcell_details.major_version) @).x'
version: stemcell/.resource/version
put: candidate-google-light-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)
Expand Down Expand Up @@ -487,8 +492,8 @@ jobs:
files:
- candidate-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)/*.tgz
options:
author_email: ci@localhost
author_name: CI Bot
author_email: *ci_bot_email
author_name: *ci_bot_name
message: 'publish (heavy): (@= data.values.stemcell_details.os_name @)/(@= str(data.values.stemcell_details.major_version) @).x'
rename: '{{.Version}}/stemcells.meta4'
version: candidate-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)/.resource/version
Expand All @@ -498,8 +503,8 @@ jobs:
files:
- candidate-(@= data.values.stemcell_details.os_name @)-fips-stemcell-(@= str(data.values.stemcell_details.major_version) @)/*.tgz
options:
author_email: ci@localhost
author_name: CI Bot
author_email: *ci_bot_email
author_name: *ci_bot_name
message: 'publish (heavy): (@= data.values.stemcell_details.os_name @)-fips/(@= str(data.values.stemcell_details.major_version) @).x'
rename: '{{.Version}}/stemcells.meta4'
version: candidate-(@= data.values.stemcell_details.os_name @)-fips-stemcell-(@= str(data.values.stemcell_details.major_version) @)/.resource/version
Expand All @@ -508,8 +513,8 @@ jobs:
files:
- candidate-aws-light-stemcell/*.tgz
options:
author_email: ci@localhost
author_name: CI Bot
author_email: *ci_bot_email
author_name: *ci_bot_name
message: 'publish (light aws): (@= data.values.stemcell_details.os_name @)/(@= str(data.values.stemcell_details.major_version) @).x'
rename: '{{.Version}}/stemcells.aws.meta4'
version: candidate-aws-light-stemcell/.resource/version
Expand Down Expand Up @@ -542,8 +547,8 @@ jobs:
files:
- candidate-google-light-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)/*.tgz
options:
author_email: ci@localhost
author_name: CI Bot
author_email: *ci_bot_email
author_name: *ci_bot_name
message: 'publish (light google): (@= data.values.stemcell_details.os_name @)/(@= str(data.values.stemcell_details.major_version) @).x'
rename: '{{.Version}}/stemcells.gcp.meta4'
version: candidate-google-light-(@= data.values.stemcell_details.os_name @)-stemcell-(@= str(data.values.stemcell_details.major_version) @)/.resource/version
Expand Down
4 changes: 2 additions & 2 deletions ci/tasks/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,6 @@ cat "$meta4_path"
cd "${REPO_PARENT}/stemcells-index-output"

git add -A
git config --global user.email "ci@localhost"
git config --global user.name "CI Bot"
git config --global user.email "${GIT_USER_EMAIL}"
git config --global user.name "${GIT_USER_NAME}"
git commit -m "dev: ${OS_NAME}-${OS_VERSION}/${CANDIDATE_BUILD_NUMBER} ($IAAS-$HYPERVISOR)"
2 changes: 2 additions & 0 deletions ci/tasks/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ params:
S3_API_ENDPOINT: s3.amazonaws.com
ESM_TOKEN:
AGENT_SUFFIX: -go_agent
GIT_USER_EMAIL:
GIT_USER_NAME:
4 changes: 2 additions & 2 deletions ci/tasks/bump-bosh-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ cp "${REPO_PARENT}/bosh-agent/.resource/version" \
pushd "${REPO_PARENT}/bosh-linux-stemcell-builder-out"
if [ "$(git status --porcelain)" != "" ]; then
git add -A
git config --global user.email "ci@localhost"
git config --global user.name "CI Bot"
git config --global user.email "${GIT_USER_EMAIL}"
git config --global user.name "${GIT_USER_NAME}"
git commit -m "bump bosh-agent/$version"
fi
popd
4 changes: 4 additions & 0 deletions ci/tasks/bump-bosh-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ outputs:

run:
path: bosh-stemcells-ci/ci/tasks/bump-bosh-agent.sh

params:
GIT_USER_EMAIL:
GIT_USER_NAME:
4 changes: 2 additions & 2 deletions ci/tasks/bump-bosh-blobstore-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ echo "${sha256sum}" > \
pushd "${REPO_PARENT}/bosh-linux-stemcell-builder-out"
if [ "$(git status --porcelain)" != "" ]; then
git add -A
git config --global user.email "ci@localhost"
git config --global user.name "CI Bot"
git config --global user.email "${GIT_USER_EMAIL}"
git config --global user.name "${GIT_USER_NAME}"
git commit -m "bump bosh-blobstore-${BLOBSTORE_TYPE}/${version}"
fi
popd
4 changes: 4 additions & 0 deletions ci/tasks/bump-bosh-blobstore-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ outputs:

run:
path: bosh-stemcells-ci/ci/tasks/bump-bosh-blobstore-cli.sh

params:
GIT_USER_EMAIL:
GIT_USER_NAME:
4 changes: 2 additions & 2 deletions ci/tasks/commit-build-time.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ formatted_build_time="$(date --date "${build_time%.*}" +%Y%m%dT%H%M%SZ)"
pushd "${REPO_PARENT}/bosh-linux-stemcell-builder"
echo "${formatted_build_time}" > build_time.txt
git add -A
git config --global user.email "ci@localhost"
git config --global user.name "CI Bot"
git config --global user.email "${GIT_USER_EMAIL}"
git config --global user.name "${GIT_USER_NAME}"
git commit -m "Commit Build Time"
popd
4 changes: 4 additions & 0 deletions ci/tasks/commit-build-time.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ outputs:

run:
path: bosh-stemcells-ci/ci/tasks/commit-build-time.sh

params:
GIT_USER_EMAIL:
GIT_USER_NAME:
14 changes: 8 additions & 6 deletions ci/tasks/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ if [[ -n "${DEBUG:-}" ]]; then
export BOSH_LOG_PATH="${BOSH_LOG_PATH:-${REPO_PARENT}/bosh-debug.log}"
fi

export VERSION=$( cat "${REPO_PARENT}/version/number" | sed 's/\.0$//;s/\.0$//' )
VERSION=$( cat "${REPO_PARENT}/version/number" | sed 's/\.0$//;s/\.0$//' )
export VERSION

#
# merge all stemcell files into a single metalink for publishing
Expand All @@ -23,14 +24,14 @@ meta4_path="${REPO_PARENT}/stemcells-index-output/$TO_INDEX/$OS_NAME-$OS_VERSION
mkdir -p "$( dirname "$meta4_path" )"
meta4 create --metalink="$meta4_path"

find "${REPO_PARENT}/stemcells-index-output/$FROM_INDEX/$OS_NAME-$OS_VERSION/$VERSION" -name "*.meta4" \
| xargs -n1 -- meta4 import-metalink --metalink="$meta4_path"
find "${REPO_PARENT}/stemcells-index-output/$FROM_INDEX/$OS_NAME-$OS_VERSION/$VERSION" -name "*.meta4" -print0 \
| xargs --null -n1 -- meta4 import-metalink --metalink="$meta4_path"

cd "${REPO_PARENT}/stemcells-index-output"

git add -A
git config --global user.email "ci@localhost"
git config --global user.name "CI Bot"
git config --global user.email "${GIT_USER_EMAIL}"
git config --global user.name "${GIT_USER_NAME}"
git commit -m "$COMMIT_PREFIX: $OS_NAME-$OS_VERSION/$VERSION"

cd "${REPO_PARENT}"
Expand Down Expand Up @@ -71,7 +72,8 @@ else

# occasionally this fails for unexpected reasons; retry a few times
for i in {1..4}; do
aws --endpoint-url=${AWS_ENDPOINT} s3 cp "s3://$FROM_BUCKET_NAME/$file" "s3://$TO_BUCKET_NAME/$file" \
echo "'s3 cp' attempt: ${i}" >&2
aws --endpoint-url="${AWS_ENDPOINT}" s3 cp "s3://$FROM_BUCKET_NAME/$file" "s3://$TO_BUCKET_NAME/$file" \
&& break \
|| sleep 5
done
Expand Down
2 changes: 2 additions & 0 deletions ci/tasks/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ params:
COPY_KEYS: required
OS_NAME: required
OS_VERSION: required
GIT_USER_EMAIL:
GIT_USER_NAME:
Loading