File tree Expand file tree Collapse file tree 4 files changed +13
-46
lines changed Expand file tree Collapse file tree 4 files changed +13
-46
lines changed Original file line number Diff line number Diff line change 5
5
- oraclejdk8
6
6
cache :
7
7
directories :
8
- - ' $HOME/.m2/repository'
8
+ - $HOME/.m2/repository
9
+ - $HOME/.cache/pip
9
10
10
11
install :
11
12
# install aws cli
@@ -15,11 +16,9 @@ install:
15
16
16
17
script : mvn clean test -Dspring.profiles.active=test
17
18
18
- after_success :
19
+ before_deploy :
19
20
# Parse branch name and determine an environment to deploy
20
21
- export ENV=$(echo "${TRAVIS_BRANCH}" | perl -ne "print $& if /(?<=deploy\/).*/")
21
- # Switch AWS Role when ENV is prod
22
- - test "${ENV}" = "prod" && source scripts/switch-production-role.sh
23
22
24
23
deploy :
25
24
- provider : script
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -5,23 +5,17 @@ if [ -z "${ENV}" ]; then
5
5
exit 1
6
6
fi
7
7
8
- # prepare tmp directory to deploy
9
- TMP_DIR=.deploy
10
-
11
- rm -rf ${TMP_DIR}
12
- mkdir ${TMP_DIR}
8
+ # Switch AWS Role when ENV is prod
9
+ if [ " ${ENV} " = " prod" ]; then
10
+ source scripts/switch-production-role.sh
11
+ fi
13
12
14
- # create jar
13
+ # create and upload jar
15
14
mvn clean package -DskipTests=true -Dmaven.javadoc.skip=true
16
- cp ./target/springboot-angular2-tutorial-0.1.0.jar ${TMP_DIR} /app.jar
17
-
18
- # create codedeploy archive
19
- tar cvzf ${TMP_DIR} /codedeploy.tar.gz -C codedeploy .
15
+ aws s3 cp ./target/springboot-angular2-tutorial-0.1.0.jar s3://deploy-${ENV} .hana053.com/micropost/app.jar
20
16
21
- # upload archives
22
- aws s3 sync .deploy s3://deploy-${ENV} .hana053.com/micropost
17
+ # Publish to SNS Topic
18
+ account_number=$( aws sts get-caller-identity --output text --query ' Account' )
19
+ aws sns publish --topic-arn " arn:aws:sns:${AWS_DEFAULT_REGION} :${account_number} :backend_app_updated" \
20
+ --message " {\" asgName\" : \" web\" }"
23
21
24
- # deploy
25
- aws deploy create-deployment --application-name micropost \
26
- --s3-location bucket=deploy-${ENV} .hana053.com,key=micropost/codedeploy.tar.gz,bundleType=tgz \
27
- --deployment-group-name web
You can’t perform that action at this time.
0 commit comments