-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
106 lines (99 loc) Β· 3.52 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
language: java
jdk:
- openjdk8
branches:
only:
- master
- develop
cache:
directories:
- "$HOME/.m2/repository"
- "$HOME/.gradle"
script: "./gradlew clean build"
env:
global:
# Set default environment variable
- AWS_REGION_DEFAULT=ap-northeast-2
- DEPLOY_DIR_DEFAULT=deploy
# If variable set in travis setting, this variable is overridden by travis setting
- AWS_REGION=${AWS_REGION_VARIABLE:-$AWS_REGION_DEFAULT}
- DEPLOY_DIR=${DEPLOY_DIR_VARIABLE:-$DEPLOY_DIR_DEFAULT}
- APP_NAME=mart-holiday-alarm
- AWS_BUCKET=${AWS_BUCKET_VARIABLE:-$APP_NAME}
- DEPLOYMENT_GROUP=$APP_NAME-group
before_deploy:
# Print build info
- echo $TRAVIS_REPO_SLUG
- echo $TRAVIS_BRANCH
# Zip by branch
- if [ "$TRAVIS_BRANCH" = "master" ]; then echo "master"; zip -r mart-holiday-alarm *; mkdir -p $DEPLOY_DIR && mv mart-holiday-alarm.zip $_; ls .; fi
- if [ "$TRAVIS_BRANCH" = "develop" ]; then echo "develop "; zip -r mart-holiday-alarm *; mkdir -p $DEPLOY_DIR && mv mart-holiday-alarm.zip $_; ls .; fi
deploy:
# develop branch
- provider: s3
access_key_id: "$AWS_ACCESS_KEY_DEV"
secret_access_key: "$AWS_SECRET_KEY_DEV"
region: $AWS_REGION
bucket: ${AWS_BUCKET}-dev
local_dir: $DEPLOY_DIR
upload_dir: $DEPLOY_DIR
skip_cleanup: true
acl: public_read
wait-until-deployed: true
on:
repo: $TRAVIS_REPO_SLUG
branch: develop
- provider: codedeploy
access_key_id: "$AWS_ACCESS_KEY_DEV"
secret_access_key: "$AWS_SECRET_KEY_DEV"
region: $AWS_REGION
bucket: ${AWS_BUCKET}-dev
key: $DEPLOY_DIR/$APP_NAME.zip
bundle_type: zip
application: $APP_NAME
deployment_group: $DEPLOYMENT_GROUP
wait-until-deployed: true
on:
repo: $TRAVIS_REPO_SLUG
branch: develop
# master branch
- provider: s3
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
region: $AWS_REGION
bucket: $AWS_BUCKET
local_dir: $DEPLOY_DIR
upload_dir: $DEPLOY_DIR
skip_cleanup: true
acl: public_read
wait-until-deployed: true
on:
repo: $TRAVIS_REPO_SLUG
branch: master
- provider: codedeploy
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
region: $AWS_REGION
bucket: $AWS_BUCKET
key: $DEPLOY_DIR/$APP_NAME.zip
bundle_type: zip
application: $APP_NAME
deployment_group: $APP_NAME-group
wait-until-deployed: true
on:
repo: $TRAVIS_REPO_SLUG
branch: master
notifications:
email:
recipients:
slack:
rooms:
- secure: "1u0ipFr/ndGCHPaH1AvBjq8y8gjif1pz9O3S42qYwb6ZYOlhjePrAKzgCyW9vYzCEthsjt9S0oFHwozrnBlwfOhdfRkOhifa1Q1g8o49Bi/X9PYsxntpAykaZNzuu396fHW7J8fEpddVBXm4jzlh2LZ+Pm5CDG5l/VptyC2iTYeItQrxLcoQgj3tecyulxBjDPFF2f0PxdITYL8Ia9utinzMtc30ta9A4xJxC8iicsu9xYxL3gvQHV59rzDrPDegjPKD/d+4pilU367odoujGdCIrsJUW/Elypxw9Nu+S3B2iFRAJ9YpCYALyMEVQdhOqMh54QFiMHiPsCE1wPq4KXvUogkWLsOVjEXxurkr6+pLAlH09IKWl2+mlJTScxRixl2FeJK9w2VzGdqAzylepfgWArBWwnMGdKjNvdrHO+FxiDKA55TEXkDCtzvkQ1KYoUtIGEYdHVKca5dgxh2jDJtYNfCztZ+8SVFk/hiEB5FM9DSOdcUGq8Qwuhbth5cMSOJrMN+mT/7LH6YG/mPDb5D8aiCAbZ6FhrqcPbuuEmEE5LMWsW6PMy29aKakvq0Es28cCJM3wtPQVGSwrXOOnxta50uN0eyv9gjPlfgR9NiS9ibhIuTelGwiSrmVGd/sV3eEMr1GIGUnuYDk5hoyzufJ3fJ/SMmzb3lBcXXMWVg="
template:
- "*Build* *<%{build_url}|#%{build_number}>* `%{result}`"
- "\n*Build Details* "
- "- λΉλ μκ° : %{duration}"
- "- λΈλμΉ : %{repository_name}@%{branch}"
- "- μ»€λ° μ λͺ© : %{commit_subject}"
- "- λ³κ²½ λ΄μ© : <%{compare_url}|%{commit}>"