Skip to content
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: make region a parameter to batch script #13097

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions scripts/cloud-cli-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ set -e
set -o allexport
source ./scripts/.env set

REGION=us-east-1

function authenticate {
account_number=$1
role_name=$2
Expand All @@ -14,7 +16,7 @@ function authenticate {
mwinit --aea
echo Loading account credentials for Account $account_number with Role: $role_name...
ada cred update --profile="${profile_name}" --account="${account_number}" --role=${role_name} --provider=isengard --once
aws configure set region us-east-1 --profile $profile_name
aws configure set region $REGION --profile $profile_name
}
function triggerProjectBatch {
account_number=$1
Expand All @@ -26,8 +28,8 @@ function triggerProjectBatch {
echo AWS Account: $account_number
echo Project: $project_name
echo Target Branch: $target_branch
RESULT=$(aws codebuild start-build-batch --profile="${profile_name}" --project-name $project_name --source-version=$target_branch \
RESULT=$(aws codebuild start-build-batch --region=$REGION --profile="${profile_name}" --project-name $project_name --source-version=$target_branch \
--environment-variables-override name=BRANCH_NAME,value=$target_branch,type=PLAINTEXT \
--query 'buildBatch.id' --output text)
echo "https://us-east-1.console.aws.amazon.com/codesuite/codebuild/$account_number/projects/$project_name/batch/$RESULT?region=us-east-1"
echo "https://$REGION.console.aws.amazon.com/codesuite/codebuild/$account_number/projects/$project_name/batch/$RESULT?region=$REGION"
}