Skip to content

Commit 6f0f447

Browse files
author
Bhavik Kumar
committed
Reorder commands and move docker commands to container push script
1 parent d16edeb commit 6f0f447

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ 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_ecr.sh; fi
5756
- ./gradlew check
58-
- if [ "TRAVIS_EVENT_TYPE" = "push" ]; then ./gradlew docker dockerTag dockerTagsPush publish -PTAG=$TRAVIS_BUILD_NUMBER -PREPOSITORY_URI=$REPOSITORY_URI; fi
57+
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then deployment/script/travis_push_container.sh; fi
5958
- if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then ./gradlew dockerPush; fi
6059
after_success:
6160
- ./gradlew sonarqube

deployment/script/travis_deploy_ecr.sh renamed to deployment/script/travis_push_container.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ export REPOSITORY_URI=$(terraform output repository_url) || exit 1
77
cd $TRAVIS_BUILD_DIR
88
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) "') || exit 1
99
$(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION) || exit 1
10+
./gradlew docker dockerTag dockerTagsPush publish -PTAG=$TRAVIS_BUILD_NUMBER -PREPOSITORY_URI=$REPOSITORY_URI || exit 1

0 commit comments

Comments
 (0)