-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
67 lines (60 loc) · 1.65 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
sudo: required
dist: trusty
language: node_js
node_js:
- "node"
addons:
sonarcloud:
organization: "matthewbill-github"
token:
secure: $SONAR_TOKEN
branches:
only:
- master
before_install:
# Setup
- sudo apt-get update
- sudo apt-get install -y jq
- pip install --upgrade --user awscli
- aws --version
script:
- npm test
- npm run lint
# Version
- npm config set git-tag-version=false # git-tag-version is false otherwise cause infinite loop
- npm version patch
- export VERSION=$(jq '.version' package.json)
- VERSION="${VERSION//\"}"
- echo $VERSION;
# Sonar
- mdb-bt sonar-update sonar-project.properties -v $VERSION -b master
- cat sonar-project.properties
- sonar-scanner
before_deploy:
# Git Configuration
- git checkout master
- git remote set-url origin https://$GIT_HUB_USER:$GIT_HUB_TOKEN@github.com/matthewbill/nvoy.git
- git config --global push.default simple
- git config user.name "Travis CI"
- git config user.email "travis@travis-ci.org"
deploy:
provider: npm
email: $MDB_NPM_EMAIL
api_key: $MDB_NPM_TOKEN
after_deploy:
# Infrastructure
- echo Validating Cloud Formation Templates
- aws cloudformation validate-template --template-body file://scripts/deployment/infrastructure-template.json
- echo Deploying Infrastructure
- aws cloudformation deploy --stack-name nvoy --template-file ./scripts/deployment/infrastructure-template.json --no-fail-on-empty-changeset
# Update Repo
- git add package.json
- git commit -m "[skip ci]"
- git push
- git tag $VERSION
- git push --tags
# Docs
- npm run docs
- aws s3 rm s3://nvoy/current --recursive
- aws s3 cp ./docs s3://nvoy/current --recursive
- aws s3 cp ./docs s3://nvoy/$VERSION --recursive