Skip to content

Commit

Permalink
add script
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolk committed Nov 28, 2023
1 parent cac8a74 commit eca7c06
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"release-rc-local": "bash -c 'source ./scripts/cloud-release.sh && RCLocal'",
"release-rc-beta": "bash -c 'source ./scripts/cloud-release.sh && RCBeta'",
"release-rc": "bash -c 'source ./scripts/cloud-release.sh && RCProd'",
"rollback": "./scripts/cloud-rollback.sh",
"tagged-release-without-e2e-local": "bash -c 'source ./scripts/cloud-release.sh && TaggedRCLocal'",
"tagged-release-without-e2e-beta": "bash -c 'source ./scripts/cloud-release.sh && TaggedRCBeta'",
"tagged-release-without-e2e-prod": "bash -c 'source ./scripts/cloud-release.sh && TaggedRCProd'",
Expand Down
22 changes: 22 additions & 0 deletions scripts/cloud-rollback.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash -e

scriptDir=$(dirname -- "$(readlink -f -- "$BASH_SOURCE")")
source $scriptDir/.env set

printf 'What version should I rollback to ? '
read ROLLBACK_TARGET_VERSION

mwinit
ada cred update --profile=AmplifyCLIReleaseProd --account=$RELEASE_ACCOUNT_PROD --role=CodebuildRelease --provider=isengard --once
RESULT=$(aws codebuild start-build-batch \
--profile=AmplifyCLIReleaseProd \
--region us-east-1 \
--project-name Rollback \
--build-timeout-in-minutes-override 60 \
--source-version "dev" \
--debug-session-enabled \
--git-clone-depth-override=1000 \
--environment-variables-override name=ROLLBACK_TARGET_VERSION,value=$ROLLBACK_TARGET_VERSION,type=PLAINTEXT \
--query 'buildBatch.id' --output text)

echo "https://us-east-1.console.aws.amazon.com/codesuite/codebuild/$RELEASE_ACCOUNT_PROD/projects/Rollback/batch/$RESULT?region=us-east-1"

0 comments on commit eca7c06

Please sign in to comment.