Skip to content

Commit

Permalink
crane
Browse files Browse the repository at this point in the history
  • Loading branch information
dntczdx committed Nov 24, 2021
1 parent 3e27e4e commit 78babd8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions rollout/cli_tools_cloudbuild_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ steps:
TOOLS_ARR=$(echo "$_TOOLS" | tr ";" "\n")
exit_on_error() {
ERR=$1
if [[ $ERR != 0 ]]; then
echo "Deploy failed with exit code $ERR. Please check the error message, debug and rerun."
exit "$ERR"
ERR=$$1
if [[ $$ERR != 0 ]]; then
echo "Deploy failed with exit code $$ERR. Please check the error message, debug and rerun."
exit "$$ERR"
fi
}
Expand All @@ -37,15 +37,15 @@ steps:
# Mark current "release" as "prev-release" for rollback.
crane tag $$_REGION-docker.pkg.dev/$_IMAGE_PROJECT/$$_TOOL:release prev-release
exit_on_error $?
exit_on_error $$?
# Copy the new "release" from gcr.io.
crane copy gcr.io/$_IMAGE_PROJECT/$$_TOOL:release $$_REGION-docker.pkg.dev/$_IMAGE_PROJECT/$$_TOOL:release
exit_on_error $?
exit_on_error $$?
crane tag $$_REGION-docker.pkg.dev/$_IMAGE_PROJECT/$$_TOOL:release $_WORKFLOW_EXECUTION_ID
exit_on_error $?
exit_on_error $$?
crane tag $$_REGION-docker.pkg.dev/$_IMAGE_PROJECT/$$_TOOL:release $COMMIT_SHA
exit_on_error $?
exit_on_error $$?
done
echo "----> Deployed all tools for $$_REGION"
done
10 changes: 5 additions & 5 deletions rollout/cli_tools_cloudbuild_deploy_rollback.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ steps:
TOOLS_ARR=$(echo "$_TOOLS" | tr ";" "\n")
exit_on_error() {
ERR=$1
if [[ $ERR != 0 ]]; then
echo "Rollback failed with exit code $ERR. Please check the error message, debug and rerun."
exit "$ERR"
ERR=$$1
if [[ $$ERR != 0 ]]; then
echo "Rollback failed with exit code $$ERR. Please check the error message, debug and rerun."
exit "$$ERR"
fi
}
Expand All @@ -36,7 +36,7 @@ steps:
echo "--> Rollback... $$_TOOL -> $$_REGION"
crane tag $$_REGION-docker.pkg.dev/$_IMAGE_PROJECT/$$_TOOL:prev-release release -q
exit_on_error $?
exit_on_error $$?
done
echo "----> Rollback all tools for $$_REGION done."
done

0 comments on commit 78babd8

Please sign in to comment.