This repository has been archived by the owner on Nov 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
.travis.yml
68 lines (55 loc) · 1.72 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
language: go
go:
- "1.11.x"
python:
- "3.5"
env:
- GO111MODULE=on
addons:
ssh_known_hosts: ec2-13-59-124-240.us-east-2.compute.amazonaws.com
before_install:
- export VITRINESOCIAL_ENV=production
- mkdir server/tmp # create storage directory
before_deploy:
- rm -f devops/vitrinesocial.pem
- openssl aes-256-cbc -K $encrypted_c41c576030a0_key -iv $encrypted_c41c576030a0_iv -in vitrinesocial.pem.enc -out devops/vitrinesocial.pem -d #decrypt aws key
- chmod 400 devops/vitrinesocial.pem
install:
- pip install --user awscli # `awscli` is required for invalidation of CloudFront distributions.
- make install
- make install-frontend
cache:
directories:
- "node_modules"
before_script:
- 'echo -e "Host *\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config'
script:
- make tests
- make tests-frontend
- make coverage
- if [ "$TRAVIS_BRANCH" == "master" ]; then
go get github.com/rubenv/sql-migrate/...;
make build && make build-frontend;
fi
deploy:
- provider: script # Deploy Backend
script: ./devops/deploy.sh
skip_cleanup: true
- provider: s3 # Deploy Frontend
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
bucket: $AWS_BUCKET
local_dir: frontend/build
region: sa-east-1
skip_cleanup: true
after_deploy:
# Allow `awscli` to make requests to CloudFront.
- aws configure set preview.cloudfront true
# Invalidate every object in the targeted distribution.
- aws cloudfront create-invalidation --distribution-id $AWS_CLOUDFRONT_DISTRIBUTION_ID --paths "/*"
after_success:
- make send-statiscs commit=$TRAVIS_COMMIT
notifications:
email:
on_success: never # default: change
on_failure: always # default: always