generated from ModusCreateOrg/template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
72 lines (63 loc) · 1.87 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
dist: xenial
language: node_js
node_js:
- 8.10.0
git:
depth: 10 # Ensure commit queues are successful
quiet: true
env:
global:
- PATH=$HOME/.local/bin:$PATH
cache:
directories:
- node_modules
- src/custom-rds/node_modules
- src/origin-request/node_modules
- src/viewer-request/node_modules
- dist
stages:
- install
- predeploy
- archive
- deploy
- postdeploy
jobs:
include:
# Install
- stage: install
name: Install Npm Dependencies
script: bash ./bin/install.sh
# Predeploy
- stage: predeploy
name: Lint (Validate Rules Against Prettier)
script: npm run lint-check-rules
- name: Lint
script: npm run lint
- name: Test (Unit & Snapshot)
script: npm run test:unit
- name: Build
script: npm run build
# Archive
- stage: archive
name: Archive
script: bash ./bin/archive.sh
# Deploy
- stage: deploy
name: Deploy
script: travis_wait 120 bash ./bin/deploy-branch.sh
before_install:
- pip install --user awscli
- npm install -g [email protected]
- sudo apt-get update
- sudo apt-get install -y brotli
install:
- # Skip
before_script:
- export BRANCH="$TRAVIS_BRANCH"
- export COMMIT="$TRAVIS_COMMIT"
- export ENVIRONMENT="$(echo $BRANCH | sed 's/^master$/production/; s/^develop$/integration/; s/^release.*$/staging/; /^production\|integration\|staging$/! s/^.*$/development/')"
- export BRANCH_SHORT="$(echo $BRANCH | sed 's/^\(master\|develop\|release\/[[:digit:]]\+\|feature\/[[:digit:]]\+\).*$/\1/')"
- export BRANCH_SLUG="$(echo $BRANCH_SHORT | sed 's/\//-/g')"
- ([ "$BRANCH" == "master" ]) && export IS_MASTER_BRANCH=true || export IS_MASTER_BRANCH=false
- $IS_MASTER_BRANCH && export IS_NOT_MASTER_BRANCH=false || export IS_NOT_MASTER_BRANCH=true
- $IS_MASTER_BRANCH && export SUBDOMAIN="www" || export SUBDOMAIN="www-$BRANCH_SLUG"