forked from dehydr8/elevation-of-privilege
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
43 lines (42 loc) · 1.52 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
matrix:
include:
- language: node_js
node_js:
- "10"
cache:
directories:
- node_modules
install:
- rm -rf node_modules/*/.git/
- npm install -q --no-color --no-progress
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- npm run test -- --coverage --watchAll=false
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
- dist: trusty
stage: build and deploy docker image
services:
- docker
if: tag IS present
env:
- COMMIT=${TRAVIS_COMMIT::8}
- REPO=okhalid/eop
before_install:
- wget -qO- https://toolbelt.heroku.com/install.sh | sh
- echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin
- echo "$HEROKU_API_KEY" | docker login -u "$HEROKU_USER" --password-stdin registry.heroku.com
script:
- docker build -f heroku/Dockerfile -t $REPO:$COMMIT .
- docker tag $REPO:$COMMIT $REPO:latest
- docker tag $REPO:$COMMIT $REPO:$TRAVIS_TAG
- docker tag $REPO:$COMMIT $REPO:$TRAVIS_TAG
- docker tag $REPO:$COMMIT registry.heroku.com/$HEROKU_APP_NAME/web
- docker push $REPO
- docker push registry.heroku.com/$HEROKU_APP_NAME/web
- heroku container:release web --app $HEROKU_APP_NAME
notifications:
email: false