forked from pact-foundation/pact-broker-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
53 lines (45 loc) · 1.59 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
sudo: required
services:
- docker
# https://github.com/travis-ci/travis-ci/issues/4778
before_install:
- sudo service docker restart; sleep 10; docker --version
# add jq in packages once it becomes pre-allowed
# https://github.com/travis-ci/apt-package-whitelist/issues/1394
addons:
apt:
packages:
- pwgen
# Each of below environment variables will trigger a separate build
# this way is possible to run the tests in different configurations
# But: Because we are using `global` instead of leaving them here
# we need to put them under env: -> matrix:
# env:
# - PACT_BROKER_PORT=9292
# - PACT_BROKER_PORT=9999
# Global environment variables apply to all configurations, i.e. we
# don't care how the tested service behaves by varying this values
env:
global:
- PSQL_CONT_NAME="postgres"
- PSQL_WAIT_TIMEOUT="20s"
- PACT_CONT_NAME="broker_app"
- PACT_WAIT_TIMEOUT="30s"
matrix:
- PACT_BROKER_PORT=9292
# - PACT_BROKER_PORT=9999
before_install:
- gem install bundler -v 2.0.2
# The test script is designed to run in a Linux machine and therefore
# in TravisCI. It also has conditionals for OSX so developers can run it there
script:
- ./script/test.sh
- ./script/test_basic_auth.sh || docker logs $PACT_CONT_NAME
# Docker cleanup though it might not be necessary as Travis probably
# cleans the used slaves anyway for this is also serves as documenting code
after_script:
- docker logs $PACT_CONT_NAME
- docker stop $PSQL_CONT_NAME || true
- docker stop $PACT_CONT_NAME || true
- docker rm $PACT_CONT_NAME || true
- docker rm $PSQL_CONT_NAME || true