This repository has been archived by the owner on Feb 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
153 lines (147 loc) · 7.44 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
services:
- docker
language: node_js
node_js:
- '10'
env:
global:
- CXX=g++-4.8
- SHUTUP=1
- TZ=Asia/Singapore
stages:
- name: test
- name: eb
if: branch IN (env(DEV_BRANCH), env(PROD_BRANCH), env(ADMIN_BRANCH))
- name: lambda
if: branch IN (env(DEV_BRANCH), env(PROD_BRANCH))
jobs:
include:
- stage: test
script:
- ls
- npm test
- git remote set-branches --add origin master
- git fetch
- echo Linting the following JS files in this branch - `git diff --name-only origin/master -- '*.js'`
- ./node_modules/eslint/bin/eslint.js --max-warnings 0 `git diff --name-only origin/master -- '*.js'`
after_success:
- echo "On success, the working directory looks like..."
- ls
- docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- export REPO=$TRAVIS_REPO_SLUG
- export TAG=`if [ "$TRAVIS_BRANCH" == "production" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
- echo "Building image $REPO:$TAG"
- cat .dockerignore
- ls
- cat Dockerfile
- docker build -f Dockerfile -t $REPO:$TRAVIS_COMMIT .
- docker tag $REPO:$TRAVIS_COMMIT $REPO:$TAG
- docker tag $REPO:$TRAVIS_COMMIT $REPO:travis-$TRAVIS_BUILD_NUMBER
- docker push $REPO
- stage: eb
script:
- npm install -g babel
- npm run build
- sed -i -e "s/@TAG/$TRAVIS_COMMIT/g" Dockerrun.aws.json
- git rm -f --ignore-unmatch Dockerfile
- rm -f Dockerfile
deploy:
- provider: elasticbeanstalk
skip_cleanup: true
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
region: "ap-southeast-1"
app: "beeline-server"
env: "beeline-server-dev"
bucket_name: "elasticbeanstalk-ap-southeast-1-882000534153"
on:
branch: $DEV_BRANCH
- provider: elasticbeanstalk
skip_cleanup: true
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
region: "ap-southeast-1"
app: "beeline-server"
env: "beeline-server-prod"
bucket_name: "elasticbeanstalk-ap-southeast-1-882000534153"
on:
branch: $PROD_BRANCH
- provider: elasticbeanstalk
skip_cleanup: true
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
region: "ap-southeast-1"
app: "beeline-server"
env: "beeline-server-admin"
bucket_name: "elasticbeanstalk-ap-southeast-1-882000534153"
on:
branch: $ADMIN_BRANCH
- stage: lambda
script:
- npm install -g babel
- npm run build
deploy:
- provider: lambda
function_name: expireStaleRoutePasses-staging
region: ap-southeast-1
role: arn:aws:iam::882000534153:role/service-role/batch
runtime: nodejs8.10
timeout: 300
memory_size: 256
handler_name: handler
module_name: dist/lib/aws/expireStaleRoutePasses
access_key_id: AKIAJQPC5ZBLGJX36AXA
secret_access_key:
secure: ClGc8wru2ABNdSYKEZ0DvVQQWKkIRN0Tvr8ae1AqhMPqimOqVMmsaLVITsHiZ07+mjnXs5kNOEouIht2tORMj1nCOrZ2oMB7dd9x6PX40/mL0kdRwWVJovUpExbY/IQfIMSijm063FapoFuhcehjEh5EtDdXsWZ+hESFI1zasQEEI0SkhCWLFgEqbNPlJoG+5oRNPMwyaMF1hLg0KeiJDyBzS14m68ERb3KoqjBNDylYfxeA2P/QuASP8ue4eIPY5/eK6qhMCw3L6LQmlYrB1SDVkSf6vFKLzlmi54gGoxGI4QpmE+TOV8P2fiMQlzPtG8yji6/zlOlPjObD+g24kBfzKHyWf9W3V20bBoZOnPCQ7vu9hMGJChHFJJrrjL2P2oPaCoTrt3u1i8v7z3FxOkYRlgxKoBgtFQEKN2vii0kR5+jDXD6JYrXjyq3sihZngasbGqbrGs+DlotuW2Lb+ApKJeJ96giyjoC4HcEVR/2LHuhHdRS34YXHNpp4Lq4ZH/ZCNhOEVwVaozRvyVt4qlB9di7puxNgnxeiQVQP8AkO8Y2LGGz1ooGLAbQLW5A+kiD5ScMaNVD6vK/611gQe8LQzA/AxhfpMJPgeE3N1uDkjToWWJ5IzuLArKaaGCm8CzSigRKBUD5+Dm91qXLfl/8xcY5KTcQvth0SUflyumg=
on:
branch: $DEV_BRANCH
- provider: lambda
function_name: expireStaleRoutePasses-prod
region: ap-southeast-1
role: arn:aws:iam::882000534153:role/service-role/batch
runtime: nodejs8.10
timeout: 300
memory_size: 256
handler_name: handler
module_name: dist/lib/aws/expireStaleRoutePasses
access_key_id: AKIAJQPC5ZBLGJX36AXA
secret_access_key:
secure: ClGc8wru2ABNdSYKEZ0DvVQQWKkIRN0Tvr8ae1AqhMPqimOqVMmsaLVITsHiZ07+mjnXs5kNOEouIht2tORMj1nCOrZ2oMB7dd9x6PX40/mL0kdRwWVJovUpExbY/IQfIMSijm063FapoFuhcehjEh5EtDdXsWZ+hESFI1zasQEEI0SkhCWLFgEqbNPlJoG+5oRNPMwyaMF1hLg0KeiJDyBzS14m68ERb3KoqjBNDylYfxeA2P/QuASP8ue4eIPY5/eK6qhMCw3L6LQmlYrB1SDVkSf6vFKLzlmi54gGoxGI4QpmE+TOV8P2fiMQlzPtG8yji6/zlOlPjObD+g24kBfzKHyWf9W3V20bBoZOnPCQ7vu9hMGJChHFJJrrjL2P2oPaCoTrt3u1i8v7z3FxOkYRlgxKoBgtFQEKN2vii0kR5+jDXD6JYrXjyq3sihZngasbGqbrGs+DlotuW2Lb+ApKJeJ96giyjoC4HcEVR/2LHuhHdRS34YXHNpp4Lq4ZH/ZCNhOEVwVaozRvyVt4qlB9di7puxNgnxeiQVQP8AkO8Y2LGGz1ooGLAbQLW5A+kiD5ScMaNVD6vK/611gQe8LQzA/AxhfpMJPgeE3N1uDkjToWWJ5IzuLArKaaGCm8CzSigRKBUD5+Dm91qXLfl/8xcY5KTcQvth0SUflyumg=
on:
branch: $PROD_BRANCH
- provider: lambda
function_name: smoketest-staging
region: ap-southeast-1
role: arn:aws:iam::882000534153:role/service-role/batch
runtime: nodejs8.10
timeout: 300
memory_size: 256
handler_name: handler
module_name: dist/lib/aws/smoketest
access_key_id: AKIAJQPC5ZBLGJX36AXA
secret_access_key:
secure: ClGc8wru2ABNdSYKEZ0DvVQQWKkIRN0Tvr8ae1AqhMPqimOqVMmsaLVITsHiZ07+mjnXs5kNOEouIht2tORMj1nCOrZ2oMB7dd9x6PX40/mL0kdRwWVJovUpExbY/IQfIMSijm063FapoFuhcehjEh5EtDdXsWZ+hESFI1zasQEEI0SkhCWLFgEqbNPlJoG+5oRNPMwyaMF1hLg0KeiJDyBzS14m68ERb3KoqjBNDylYfxeA2P/QuASP8ue4eIPY5/eK6qhMCw3L6LQmlYrB1SDVkSf6vFKLzlmi54gGoxGI4QpmE+TOV8P2fiMQlzPtG8yji6/zlOlPjObD+g24kBfzKHyWf9W3V20bBoZOnPCQ7vu9hMGJChHFJJrrjL2P2oPaCoTrt3u1i8v7z3FxOkYRlgxKoBgtFQEKN2vii0kR5+jDXD6JYrXjyq3sihZngasbGqbrGs+DlotuW2Lb+ApKJeJ96giyjoC4HcEVR/2LHuhHdRS34YXHNpp4Lq4ZH/ZCNhOEVwVaozRvyVt4qlB9di7puxNgnxeiQVQP8AkO8Y2LGGz1ooGLAbQLW5A+kiD5ScMaNVD6vK/611gQe8LQzA/AxhfpMJPgeE3N1uDkjToWWJ5IzuLArKaaGCm8CzSigRKBUD5+Dm91qXLfl/8xcY5KTcQvth0SUflyumg=
on:
branch: $DEV_BRANCH
- provider: lambda
function_name: smoketest-prod
region: ap-southeast-1
role: arn:aws:iam::882000534153:role/service-role/batch
runtime: nodejs8.10
timeout: 300
memory_size: 256
handler_name: handler
module_name: dist/lib/aws/smoketest
access_key_id: AKIAJQPC5ZBLGJX36AXA
secret_access_key:
secure: ClGc8wru2ABNdSYKEZ0DvVQQWKkIRN0Tvr8ae1AqhMPqimOqVMmsaLVITsHiZ07+mjnXs5kNOEouIht2tORMj1nCOrZ2oMB7dd9x6PX40/mL0kdRwWVJovUpExbY/IQfIMSijm063FapoFuhcehjEh5EtDdXsWZ+hESFI1zasQEEI0SkhCWLFgEqbNPlJoG+5oRNPMwyaMF1hLg0KeiJDyBzS14m68ERb3KoqjBNDylYfxeA2P/QuASP8ue4eIPY5/eK6qhMCw3L6LQmlYrB1SDVkSf6vFKLzlmi54gGoxGI4QpmE+TOV8P2fiMQlzPtG8yji6/zlOlPjObD+g24kBfzKHyWf9W3V20bBoZOnPCQ7vu9hMGJChHFJJrrjL2P2oPaCoTrt3u1i8v7z3FxOkYRlgxKoBgtFQEKN2vii0kR5+jDXD6JYrXjyq3sihZngasbGqbrGs+DlotuW2Lb+ApKJeJ96giyjoC4HcEVR/2LHuhHdRS34YXHNpp4Lq4ZH/ZCNhOEVwVaozRvyVt4qlB9di7puxNgnxeiQVQP8AkO8Y2LGGz1ooGLAbQLW5A+kiD5ScMaNVD6vK/611gQe8LQzA/AxhfpMJPgeE3N1uDkjToWWJ5IzuLArKaaGCm8CzSigRKBUD5+Dm91qXLfl/8xcY5KTcQvth0SUflyumg=
on:
branch: $PROD_BRANCH
addons:
postgresql: '9.6'
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- postgresql-9.6-postgis-2.3
- g++-4.8