From cde03a47f0401602d45e4840ba2a0edbf76c1cdf Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Wed, 9 Aug 2023 15:32:33 +0000 Subject: [PATCH] pipeline(precompile): refine blobstore related error detection We ensure 'error' and 'blobstore' keywords are matched on the same line... --- concourse/pipelines/template/bosh-precompile-pipeline.yml.erb | 2 +- .../fixtures/references/simple-depls-bosh-precompile-ref.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/concourse/pipelines/template/bosh-precompile-pipeline.yml.erb b/concourse/pipelines/template/bosh-precompile-pipeline.yml.erb index a3c4d24b..01b4b557 100644 --- a/concourse/pipelines/template/bosh-precompile-pipeline.yml.erb +++ b/concourse/pipelines/template/bosh-precompile-pipeline.yml.erb @@ -533,7 +533,7 @@ jobs: echo "Exporting ${RELEASE_NAME}/${RELEASE_VERSION} - ${STEMCELL_OS}/${STEMCELL_VERSION}" 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) + BLOBSTORE_ERROR_COUNT=$(grep -i error|grep -i "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 diff --git a/spec/scripts/generate-depls/fixtures/references/simple-depls-bosh-precompile-ref.yml b/spec/scripts/generate-depls/fixtures/references/simple-depls-bosh-precompile-ref.yml index b2f3cdfc..92172cbe 100644 --- a/spec/scripts/generate-depls/fixtures/references/simple-depls-bosh-precompile-ref.yml +++ b/spec/scripts/generate-depls/fixtures/references/simple-depls-bosh-precompile-ref.yml @@ -346,7 +346,7 @@ jobs: echo "Exporting ${RELEASE_NAME}/${RELEASE_VERSION} - ${STEMCELL_OS}/${STEMCELL_VERSION}" 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) + BLOBSTORE_ERROR_COUNT=$(grep -i error|grep -i "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 @@ -476,7 +476,7 @@ jobs: echo "Exporting ${RELEASE_NAME}/${RELEASE_VERSION} - ${STEMCELL_OS}/${STEMCELL_VERSION}" 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) + BLOBSTORE_ERROR_COUNT=$(grep -i error|grep -i "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