-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
95 lines (87 loc) · 2.63 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
dist: trusty
language: node_js
node_js:
- "8.9.3"
sudo: true
branches:
only:
- master
- dev
- server-object-refactor
- report-archive
notifications:
slack: miturbanrisklab:4y7wfdHde8dtfb00wTfNZfTA
addons:
postgresql: "10"
apt:
packages:
- postgresql-10-postgis-2.4
- proj-bin
- postgresql-10-postgis-2.4-scripts
before_install:
- sudo cp /etc/postgresql/9.6/main/pg_hba.conf /etc/postgresql/10/main/pg_hba.conf
- sudo /etc/init.d/postgresql restart
- export PGPORT=5433
- npm i -g npm@5.0.3
- if [[ $TRAVIS_BRANCH != 'master' ]]; then BRANCH='dev'; else BRANCH='master'; fi;
- export PGDATABASE=cognicity_server_testing ; git clone -b $BRANCH https://github.com/urbanriskmap/cognicity-schema.git urbanriskmap/cognicity-schema && cd urbanriskmap/cognicity-schema && bash build/run.sh && cd -
install:
- npm install
after_success: npm run coverage
before_deploy:
- npm run jsdoc
- npm run build && zip -r dist.zip . -x "*node_modules*" "*.git*" "*src*" "*jsdoc*"
deploy: #build the docs for dev branch only
- provider: s3
bucket: "dev-cognicity-server-docs"
region: "us-east-1"
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
skip_cleanup: true
local_dir: jsdoc
on:
branch: dev
- provider: elasticbeanstalk # deploy the dev us server
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
region: $AWS_EB_REGION_US
app: $AWS_EB_APP_US
env: $AWS_EB_APP_ENV_US_DEV
bucket_name: $AWS_EB_APP_BUCKET_US_DEV
skip_cleanup: true
zip_file: dist.zip
on:
branch: dev
- provider: elasticbeanstalk # deploy the prod us server
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
region: $AWS_EB_REGION_US
app: $AWS_EB_APP_US
env: $AWS_EB_APP_ENV_US_PROD
bucket_name: $AWS_EB_APP_BUCKET_US_PROD
skip_cleanup: true
zip_file: dist.zip
on:
branch: master
- provider: elasticbeanstalk # deploy the dev in server
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
region: $AWS_EB_REGION_IN
app: $AWS_EB_APP_IN
env: $AWS_EB_APP_ENV_IN_DEV
bucket_name: $AWS_EB_APP_BUCKET_IN_DEV
skip_cleanup: true
zip_file: dist.zip
on:
branch: dev
- provider: elasticbeanstalk # deploy the prod in server
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
region: $AWS_EB_REGION_IN
app: $AWS_EB_APP_IN
env: $AWS_EB_APP_ENV_IN_PROD
bucket_name: $AWS_EB_APP_BUCKET_IN_PROD
skip_cleanup: true
zip_file: dist.zip
on:
branch: master