This repository has been archived by the owner on Jul 9, 2019. It is now read-only.
forked from adrianbarwicki/vicigo
-
Notifications
You must be signed in to change notification settings - Fork 11
/
.travis.yml
76 lines (65 loc) · 2.62 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
notifications:
slack: $SLACK_TOKEN
cache:
directories:
- node_modules
addons:
sauce_connect: true
chrome: stable
dist: trusty
language: node_js
node_js:
- 9
matrix:
include:
- name: "honestcash"
sudo: false
install:
- npm install
- npm install -C ./honestcash-v2
script:
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then npm run build:prod; fi
- if [[ "$TRAVIS_BRANCH" != "master" ]]; then npm run build:dev; fi
# enable it once all the linting errors are fixed:
# - npm run lint
- npm run transfer-libs
- npm run test
# build V2 depending on the branch
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then npm run build --prod -C ./honestcash-v2; fi
- if [[ "$TRAVIS_BRANCH" != "master" ]]; then npm run build --configuration=development -C ./honestcash-v2; fi
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then npm run build:ssr:prod -C ./honestcash-v2; fi
- if [[ "$TRAVIS_BRANCH" != "master" ]]; then npm run build:ssr:dev -C ./honestcash-v2; fi
- npm run test -C ./honestcash-v2
before_deploy:
- npm prune --production
- du -d 1 -h
- mkdir deployments
- mv ./honestcash-v2/dist ./dist
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then zip -r deployments/honestcash-prod.zip public dist node_modules server views app.js package.json .env appspec.yml scripts -q; fi
- if [[ "$TRAVIS_BRANCH" == "dev" ]]; then zip -r deployments/honestcash-dev.zip public dist node_modules server views app.js package.json .env appspec.yml scripts -q; fi
# The deployment process is triggered for both master and dev
deploy:
- provider: s3
# You can refer to environment variables from Travis repo settings!
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
# Name of the S3 bucket to which your site should be uploaded.
bucket: codedeploy-honestcash
# Prevent Travis from deleting your built site so it can be uploaded.
skip_cleanup: true
# Path to a directory containing your built site.
local_dir: deployments
on:
branch: master
- provider: s3
# You can refer to environment variables from Travis repo settings!
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
# Name of the S3 bucket to which your site should be uploaded.
bucket: codedeploy-honestcash
# Prevent Travis from deleting your built site so it can be uploaded.
skip_cleanup: true
# Path to a directory containing your built site.
local_dir: deployments
on:
branch: dev