Skip to content

Commit a912613

Browse files
committed
Merge branch 'deploy/prod' into deploy/stg
2 parents 159e042 + 20c763e commit a912613

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ before_deploy:
2525
- aws --version
2626
# Parse branch name and determine an environment to deploy
2727
- export ENV=$(echo "${TRAVIS_BRANCH}" | perl -ne "print $& if /(?<=deploy\/).*/")
28-
# account number to mask
29-
- account_number=$(aws sts get-caller-identity --output text --query 'Account')
3028
# prune to reduce package size
3129
- npm prune --production
3230
deploy:
3331
- provider: script
34-
script: ./scripts/deploy.sh ${ENV} | sed -e "s/${account_number}/SECRET/g"
32+
script: ./scripts/deploy.sh ${ENV}
3533
skip_cleanup: true
3634
on:
3735
branch: deploy/*

scripts/deploy.sh

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,10 @@ set -u
55
ENV=$1
66

77
if [ "${ENV}" = "prod" ]; then
8-
# reset current role if exists
9-
test ! -v AWS_SESSION_TOKEN && direnv reload
10-
# switch to production role
118
source scripts/switch-production-role.sh
129
fi
1310

14-
sls deploy -v --stage ${ENV}
11+
# account number to mask
12+
account_number=$(aws sts get-caller-identity --output text --query 'Account')
1513

16-
if [ "${ENV}" = "prod" ]; then
17-
# reset current role if exists
18-
test ! -v AWS_SESSION_TOKEN && direnv reload
19-
fi
14+
sls deploy -v --stage ${ENV} | sed -e "s/${account_number}/SECRET/g"

0 commit comments

Comments
 (0)