Skip to content

Commit 9de7018

Browse files
author
Bhavik Kumar
committed
Move repository uri environment variable to ecr script
1 parent 0980de9 commit 9de7018

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- export AWS_SECRET_ACCESS_KEY=$DEPLOYMENT_SECRET_ACCESS_KEY
5454
- unset AWS_SESSION_TOKEN
5555
script:
56-
- if [ "TRAVIS_EVENT_TYPE" = "push" ]; then deployment/script/travis_deploy.sh; export REPOSITORY_URI=$(terraform output repository_url); fi
56+
- if [ "TRAVIS_EVENT_TYPE" = "push" ]; then deployment/script/travis_deploy.sh; fi
5757
- cd $TRAVIS_BUILD_DIR
5858
- eval $(aws sts assume-role --role-arn "$OPERATIONS_ROLE_ARN" --role-session-name "${TRAVIS_REPO_SLUG//\//-}" | jq -r '.Credentials | @sh "export AWS_SESSION_TOKEN=\(.SessionToken)\nexport AWS_ACCESS_KEY_ID=\(.AccessKeyId)\nexport AWS_SECRET_ACCESS_KEY=\(.SecretAccessKey) "')
5959
- $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION)

deployment/script/travis_deploy_ecr.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
cd deployment/terraform/ecr
44
terraform init -backend-config="bucket=${STATE_S3_BUCKET}" -backend-config="region=${AWS_DEFAULT_REGION}" -backend-config="dynamodb_table=${STATE_DYNAMODB_TABLE}" -backend-config="kms_key_id=${KMS_KEY_ID}" -backend-config="key=${KEY}" -backend-config="role_arn=${ROLE_ARN}" 1>/dev/null || exit 1
55
terraform apply -backup="-" -input=false -auto-approve -var role_arn=${ROLE_ARN} -var service_name=${SERVICE_NAME} -var tags="{\"AuthorName\":\"${AUTHOR_NAME}\",\"GitRepository\":\"${TRAVIS_REPO_SLUG}\"}" 1>/dev/null || exit 1
6+
export REPOSITORY_URI=$(terraform output repository_url)

0 commit comments

Comments
 (0)