Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipeline(precompile): detect blobstore related errors #435

Merged
merged 1 commit into from
Aug 8, 2023
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
20 changes: 18 additions & 2 deletions concourse/pipelines/template/bosh-precompile-pipeline.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -522,15 +522,31 @@ jobs:
outputs:
- name: exported-release
run:
path: sh
path: bash
args:
- -ec
- |
set -o pipefail
STEMCELL_INFO=$(bosh inspect-local-stemcell --json stemcell/*.tgz | jq '.Tables|.[0]|.Rows|.[0]')
export STEMCELL_OS=$(echo ${STEMCELL_INFO} | jq -r '.["os"]')
export STEMCELL_VERSION=$(echo ${STEMCELL_INFO} | jq -r '.["version"]')
echo "Exporting ${RELEASE_NAME}/${RELEASE_VERSION} - ${STEMCELL_OS}/${STEMCELL_VERSION}"
bosh export-release "${RELEASE_NAME}/${RELEASE_VERSION}" "${STEMCELL_OS}/${STEMCELL_VERSION}" --dir=exported-release
TIMESTAMP=$(date +'%Y-%m-%d-%H-%M-%S')
if ! bosh export-release "${RELEASE_NAME}/${RELEASE_VERSION}" "${STEMCELL_OS}/${STEMCELL_VERSION}" --dir=exported-release --tty|tee exported-release/${RELEASE_NAME}-${RELEASE_VERSION}-${TIMESTAMP}.log;then
BLOBSTORE_ERROR_COUNT=$(grep "blobstore" exported-release/${RELEASE_NAME}-${RELEASE_VERSION}-${TIMESTAMP}.log |wc -l)
if [ $BLOBSTORE_ERROR_COUNT -gt 0 ];then
echo "COA - Blobstore error detected, cleaning deployment and release"
bosh delete-deployment --non-interactive
bosh delete-release ${RELEASE_NAME}/${RELEASE_VERSION} --non-interactive
else
echo "" # new line
echo "COA - No blobstore error detected, retry without cleaning."
fi
exit 1
else
echo "" # new line
echo "COA - Bosh export-release successful"
fi
params:
BOSH_DEPLOYMENT: <%= release %>-deployment
BOSH_ENVIRONMENT: ((bosh-target))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,15 +335,31 @@ jobs:
outputs:
- name: exported-release
run:
path: sh
path: bash
args:
- -ec
- |
set -o pipefail
STEMCELL_INFO=$(bosh inspect-local-stemcell --json stemcell/*.tgz | jq '.Tables|.[0]|.Rows|.[0]')
export STEMCELL_OS=$(echo ${STEMCELL_INFO} | jq -r '.["os"]')
export STEMCELL_VERSION=$(echo ${STEMCELL_INFO} | jq -r '.["version"]')
echo "Exporting ${RELEASE_NAME}/${RELEASE_VERSION} - ${STEMCELL_OS}/${STEMCELL_VERSION}"
bosh export-release "${RELEASE_NAME}/${RELEASE_VERSION}" "${STEMCELL_OS}/${STEMCELL_VERSION}" --dir=exported-release
TIMESTAMP=$(date +'%Y-%m-%d-%H-%M-%S')
if ! bosh export-release "${RELEASE_NAME}/${RELEASE_VERSION}" "${STEMCELL_OS}/${STEMCELL_VERSION}" --dir=exported-release --tty|tee exported-release/${RELEASE_NAME}-${RELEASE_VERSION}-${TIMESTAMP}.log;then
BLOBSTORE_ERROR_COUNT=$(grep "blobstore" exported-release/${RELEASE_NAME}-${RELEASE_VERSION}-${TIMESTAMP}.log |wc -l)
if [ $BLOBSTORE_ERROR_COUNT -gt 0 ];then
echo "COA - Blobstore error detected, cleaning deployment and release"
bosh delete-deployment --non-interactive
bosh delete-release ${RELEASE_NAME}/${RELEASE_VERSION} --non-interactive
else
echo "" # new line
echo "COA - No blobstore error detected, retry without cleaning."
fi
exit 1
else
echo "" # new line
echo "COA - Bosh export-release successful"
fi
params:
BOSH_DEPLOYMENT: ntp_boshrelease-deployment
BOSH_ENVIRONMENT: ((bosh-target))
Expand Down Expand Up @@ -450,15 +466,31 @@ jobs:
outputs:
- name: exported-release
run:
path: sh
path: bash
args:
- -ec
- |
set -o pipefail
STEMCELL_INFO=$(bosh inspect-local-stemcell --json stemcell/*.tgz | jq '.Tables|.[0]|.Rows|.[0]')
export STEMCELL_OS=$(echo ${STEMCELL_INFO} | jq -r '.["os"]')
export STEMCELL_VERSION=$(echo ${STEMCELL_INFO} | jq -r '.["version"]')
echo "Exporting ${RELEASE_NAME}/${RELEASE_VERSION} - ${STEMCELL_OS}/${STEMCELL_VERSION}"
bosh export-release "${RELEASE_NAME}/${RELEASE_VERSION}" "${STEMCELL_OS}/${STEMCELL_VERSION}" --dir=exported-release
TIMESTAMP=$(date +'%Y-%m-%d-%H-%M-%S')
if ! bosh export-release "${RELEASE_NAME}/${RELEASE_VERSION}" "${STEMCELL_OS}/${STEMCELL_VERSION}" --dir=exported-release --tty|tee exported-release/${RELEASE_NAME}-${RELEASE_VERSION}-${TIMESTAMP}.log;then
BLOBSTORE_ERROR_COUNT=$(grep "blobstore" exported-release/${RELEASE_NAME}-${RELEASE_VERSION}-${TIMESTAMP}.log |wc -l)
if [ $BLOBSTORE_ERROR_COUNT -gt 0 ];then
echo "COA - Blobstore error detected, cleaning deployment and release"
bosh delete-deployment --non-interactive
bosh delete-release ${RELEASE_NAME}/${RELEASE_VERSION} --non-interactive
else
echo "" # new line
echo "COA - No blobstore error detected, retry without cleaning."
fi
exit 1
else
echo "" # new line
echo "COA - Bosh export-release successful"
fi
params:
BOSH_DEPLOYMENT: zookeeper_boshrelease-deployment
BOSH_ENVIRONMENT: ((bosh-target))
Expand Down