Skip to content

Commit 026403c

Browse files
authored
Merge pull request #965 from Amplifiyer/addCloudPr
chore: add script to run PR workflow from command line
2 parents 5503c17 + 8123496 commit 026403c

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"trigger-deprecate-release": "source ./scripts/cloud-release.sh && deprecateRelease",
4040
"view-test-artifact": "./scripts/view-test-artifacts.sh",
4141
"cleanup-stale-resources": "source ./scripts/cloud-utils.sh && cleanupStaleResources",
42+
"cloud-pr": "./scripts/cloud-pr.sh",
4243
"cloud-e2e": "source scripts/cloud-utils.sh && cloudE2E",
4344
"cloud-e2e-beta": "source scripts/cloud-utils.sh && cloudE2EBeta",
4445
"split-e2e-tests": "yarn ts-node ./scripts/split-e2e-tests.ts && git add .codebuild/e2e_workflow.yml",

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-codegen-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-codegen-pr-workflow/batch/$RESULT?region=us-east-1"

0 commit comments

Comments
 (0)