-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
46 lines (37 loc) · 1.33 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:
- '8'
notifications:
email: false # default notification method
slack:
rooms:
- travelblocks:nbxAWnqteN1m3pj47UAUNfZS
on_success: change # default: always
on_failure: always # default: always
template:
- "Repo `%{repository_slug}` *%{result}* build (<%{build_url}|#%{build_number}>) for commit (<%{compare_url}|%{commit}>) on branch `%{branch}`."
- "Execution time: *%{duration}*"
- "Message: %{message}"
services:
- docker
env:
DOCKER_COMPOSE_VERSION: 1.22.0
before_install:
# Let's stop postgresql as Travis starts its own
- sudo service postgresql stop
# wait for postgresql to shutdown
- while sudo lsof -Pi :5432 -sTCP:LISTEN -t; do sleep 1; done
# Install docker compose
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
before_script:
# Strat postgres and api in their own containers
- docker-compose up --build -d
# Create the table
- docker-compose exec api ./node_modules/.bin/knex migrate:latest --env development --knexfile ./knexfile.js
script:
- docker-compose run api npm test -- --coverage
after_script:
- docker-compose down