Skip to content

Commit 4662918

Browse files
committed
chore: add script to run PR workflow from command line
1 parent 20f76a6 commit 4662918

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"cloud-e2e-beta": "source scripts/cloud-utils.sh && cloudE2EBeta",
1616
"cloud-e2e-debug": "source scripts/cloud-utils.sh && cloudE2EDebug",
1717
"cloud-e2e": "source scripts/cloud-utils.sh && cloudE2E",
18+
"cloud-pr": "./scripts/cloud-pr.sh",
1819
"commit": "git-cz",
1920
"coverage": "codecov || exit 0",
2021
"depcheck": "eslint --no-eslintrc --config depcheck.config.js",

scripts/cloud-pr.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash -e
2+
3+
scriptDir=$(dirname -- "$(readlink -f -- "$BASH_SOURCE")")
4+
source $scriptDir/.env set
5+
6+
printf 'What is your PR number ? '
7+
read PR_NUMBER
8+
9+
if [[ -n $USE_FIDO_KEY ]] ; then
10+
mwinit -s -f
11+
else
12+
mwinit
13+
fi
14+
15+
ada cred update --profile=AmplifyAPIE2EProd --account=$E2E_ACCOUNT_PROD --role=CodebuildDeveloper --provider=isengard --once
16+
RESULT=$(aws codebuild start-build-batch \
17+
--profile=AmplifyAPIE2EProd \
18+
--region us-east-1 \
19+
--project-name amplify-category-api-pr-workflow \
20+
--build-timeout-in-minutes-override 180 \
21+
--source-version "pr/$PR_NUMBER" \
22+
--debug-session-enabled \
23+
--git-clone-depth-override=1000 \
24+
--environment-variables-override name=AMPLIFY_CI_MANUAL_PR_BUILD,value=true,type=PLAINTEXT \
25+
--query 'buildBatch.id' --output text)
26+
27+
echo "https://us-east-1.console.aws.amazon.com/codesuite/codebuild/$E2E_ACCOUNT_PROD/projects/amplify-category-api-pr-workflow/batch/$RESULT?region=us-east-1"

0 commit comments

Comments
 (0)