This repository has been archived by the owner on Aug 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
77 lines (77 loc) · 2.42 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
language: node_js
env:
global:
- CC_TEST_REPORTER_ID=fc64d003bdf120b91db2a980408cf2073efe351171845840b1fa6a0d87b658ea
node_js:
- "10"
cache:
yarn: true
directories:
- "$HOME/.mongodb-binaries"
- node_modules
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
- yarn global add greenkeeper-lockfile@1
- yarn global add parcel-bundler
before_script:
- greenkeeper-lockfile-update
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
> ./cc-test-reporter
- chmod +x ./cc-test-reporter
script:
- yarn build
- cd packages/frontend
- mkdir html
- mv dist/index.html html/index.html
- cd ../../
- cd packages/shared
- yarn test
- cd ../backend
- yarn test
- cd ../../
- cp -Lr packages/backend/node_modules packages/backend/dist/node_modules
- cd packages/backend
- zip -q -r backend-docker.zip .
- cd ../../
after_script:
- cd packages/shared
- "../../cc-test-reporter format-coverage -o /tmp/codeclimate.shared.json"
- cd ../backend
- "../../cc-test-reporter format-coverage -o /tmp/codeclimate.backend.json"
- cd ../../
- "./cc-test-reporter sum-coverage /tmp/codeclimate.*.json -p 2 -o tmp/codeclimate.total.json"
- "./cc-test-reporter upload-coverage -i tmp/codeclimate.total.json"
- greenkeeper-lockfile-upload
before_deploy:
- export ELASTIC_BEANSTALK_LABEL=git-$(git rev-parse --verify HEAD --short)
- export ELASTIC_BEANSTALK_DESCRIPTION=Desc
deploy:
- provider: s3
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
bucket: $AWS_FRONTEND_BUCKET
region: eu-west-1
cache_control: "public,max-age=604800"
local_dir: packages/frontend/dist
skip_cleanup: true
- provider: s3
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
bucket: $AWS_FRONTEND_BUCKET
region: eu-west-1
local_dir: packages/frontend/html
skip_cleanup: true
- provider: elasticbeanstalk
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
region: eu-west-1
app: $AWS_EB_APP
env: $AWS_EB_APP_ENV
bucket_name: $AWS_APP_ARTIFACTS
zip_file: packages/backend/backend-docker.zip
skip_cleanup: true
after_deploy:
- pip install --user awscli
- export PATH=$PATH:$HOME/.local/bin
- aws cloudfront create-invalidation --distribution-id $AWS_CF_DISTRIBUTION_ID --paths "/*"