forked from thoughtworks/build-your-own-radar
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
40 lines (40 loc) · 1.18 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
language: node_js
node_js:
- '10'
- '12'
jobs:
include:
- stage: test
script: npm test
- stage: deploy
script: API_KEY=$API_KEY CLIENT_ID=$CLIENT_ID npm run build
deploy:
provider: s3
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
bucket: myradar-qa
acl: public_read
skip_cleanup: true
local_dir: dist
on:
repo: thoughtworks/build-your-own-radar
condition: "$TRAVIS_PULL_REQUEST = false"
- stage: invalidation
install: pip install --user awscli && export PATH=$PATH:$HOME/.local/bin
script: 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then aws configure set preview.cloudfront true && aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/*"; fi'
- stage: e2e
if: branch = master
script: npm run end_to_end_test
stages:
- name: test
if: type = pull_request OR type = push
- name: deploy
if: type = push AND branch = master
- name: invalidation
if: type = push AND branch = master
- name: e2e
if: type = push AND branch = master
addons:
apt:
packages:
- libgconf-2-4