-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Setup e2e scripts #12629
Merged
Merged
ci: Setup e2e scripts #12629
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a9be8be
ci: remove dependance on webhooks
awsluja 856f306
ci: try again
awsluja 39b15ed
ci: migrate to manual cb triggers for e2e
awsluja 7f5249e
ci: set region if not defined
awsluja 3fe4345
ci: cleanup
awsluja 3c2e0df
ci: refactor
awsluja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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= |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if it would be a good idea to move all of the codebuild scripts into the codebuild-specs directory, instead of having them mixed in with circle ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea; seems like we are in a good spot to make a switch over; so I'll create a separate PR for that cleanup