forked from Human-Connection/API
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
46 lines (43 loc) · 1.42 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
language: node_js
node_js:
- "10"
cache:
yarn: true
directories:
- node_modules
services:
# we need docker for building the image and mongo for testing
- docker
- mongodb
# install:
# nothing!
jobs:
include:
- stage: Prepare Cache
script: true
- stage: Build and Test
script:
- docker build -t humanconnection/api-feathers .
- script:
- yarn install --frozen-lockfile --non-interactive
- yarn global add codacy-coverage
- yarn run ci
- cat ./coverage/lcov.info | codacy-coverage
after_success:
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh success $WEBHOOK_URL
- if [ $TRAVIS_BRANCH == "master" ] && [ $TRAVIS_EVENT_TYPE == "push" ]; then
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
docker tag humanconnection/api-feathers humanconnection/api-feathers:alpha;
docker push humanconnection/api-feathers:alpha;
fi
- if [ $TRAVIS_BRANCH == "develop" ] && [ $TRAVIS_EVENT_TYPE == "push" ]; then
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
docker tag humanconnection/api-feathers humanconnection/api-feathers:edge;
docker push humanconnection/api-feathers:edge;
fi
after_failure:
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh failure $WEBHOOK_URL