-
Notifications
You must be signed in to change notification settings - Fork 825
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci: remove dependance on webhooks * ci: try again * ci: migrate to manual cb triggers for e2e * ci: set region if not defined * ci: cleanup * ci: refactor
- Loading branch information
Showing
4 changed files
with
65 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
# set exit on error to true | ||
set -e | ||
# load .env | ||
set -o allexport | ||
source ./scripts/.env set | ||
export CURR_BRANCH=$(git branch --show-current) | ||
function authenticate { | ||
echo Authenticating terminal... | ||
mwinit | ||
echo Loading E2E account credentials... | ||
ada cred update --profile="${CLOUD_E2E_PROFILE}" --account="${CLOUD_E2E_ACCOUNT}" --role=CodeBuildE2E --provider=isengard --once | ||
aws configure set region us-east-1 --profile $CLOUD_E2E_PROFILE | ||
} | ||
function triggerBuild { | ||
echo Submitting CodeBuild Request to AWS Account: $CLOUD_E2E_ACCOUNT | ||
echo Current branch is: $CURR_BRANCH | ||
echo E2E Target branch is: $TARGET_BRANCH | ||
RESULT=$(aws codebuild start-build-batch --profile="${CLOUD_E2E_PROFILE}" --project-name AmplifyCLI-E2E-Testing --source-version=$TARGET_BRANCH --query 'buildBatch.id' --output text) | ||
echo "https://us-east-1.console.aws.amazon.com/codesuite/codebuild/$CLOUD_E2E_ACCOUNT/projects/AmplifyCLI-E2E-Testing/batch/$RESULT?region=us-east-1" | ||
} | ||
function cloudE2EBeta { | ||
echo Running Beta E2E Test Suite | ||
export CLOUD_E2E_PROFILE=AmplifyCLIE2EBeta | ||
export CLOUD_E2E_ACCOUNT=$E2E_ACCOUNT_BETA | ||
export TARGET_BRANCH=$CURR_BRANCH | ||
authenticate | ||
triggerBuild | ||
} | ||
function cloudE2E { | ||
echo Running Prod E2E Test Suite | ||
export CLOUD_E2E_PROFILE=AmplifyCLIE2E | ||
export CLOUD_E2E_ACCOUNT=$E2E_ACCOUNT_PROD | ||
export TARGET_BRANCH=run-e2e/$USER/$CURR_BRANCH | ||
git push $(git remote -v | grep aws-amplify/amplify-cli | head -n1 | awk '{print $1;}') $CURR_BRANCH:$TARGET_BRANCH --no-verify --force-with-lease | ||
authenticate | ||
triggerBuild | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
E2E_ACCOUNT_BETA= | ||
E2E_ACCOUNT_PROD= | ||
RELEASE_ACCOUNT_BETA= | ||
RELEASE_ACCOUNT_PROD= |