-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
85 lines (74 loc) · 2.96 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# -*- coding: utf-8 -*-
matrix:
fast_finish: true
include:
- python: '3.5'
env:
DOCKER_COMPOSE_VERSION: 1.8.0
TEST_TARGET: default
DOCKER_DATA: "$HOME/docker_data"
DOCKER_VERSION: 17.03.1~ce-0~ubuntu-trusty
DOCKER_COMPOSE_VERSION: 1.8.0
sudo: required
dist: trusty
language: python
group: edge
services:
- docker
before_install:
- sudo apt-get update
- travis_retry pip install coveralls
- sudo apt-cache search docker
# List available docker versions.
- apt-cache madison docker-ce
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce=$DOCKER_VERSION
# Update Docker. See: https://graysonkoonce.com/managing-docker-and-docker-compose-versions-on-travis-ci/.
# - sudo apt-get -o Dpkg::Options::="--force-confnew" install -y --force-yes docker.io
# Add docker-compose at the version specified in ENV.
- sudo rm -f /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
- docker-compose --version
cache:
apt: true
install:
- travis_retry docker-compose pull
# set containers as privileged to bypass Travis environment limitations
# NOTE: Before the docker-compose.test.yml modification this worked correctly:
- 'sed -i "/build: ./a \ \ privileged: true" docker-compose.yml'
# NOTE: When we move to docker-compose v2+ uncomment this below
# - 'sed -i "/dockerfile: Dockerfile/a \ \ \ \ privileged: true" docker-compose.test.yml'
script:
# - travis_retry docker-compose -f docker-compose.yml -f ci_build.yml build
# run goss tests next
- travis_retry docker-compose -f docker-compose.test.yml -f ci_build.yml up --build
# source: https://github.com/inspirehep/inspire-next/blob/9700274c36074a3e43168bf48b8ba3e3bfa7bcdf/.travis.yml
after_script:
# Killing via SIGTERM in order to trigger atexit and dump coverage information in WSGI
- "docker-compose -f docker-compose.test.yml kill -s SIGTERM"
- "docker images"
- "docker ps -a"
notifications:
email:
recipients:
on_success: always # default: change
on_failure: always # default: always
NOTE: For now we need to wait on this
after_success:
# Tag the docker images using the commit hash
# - make docker_build_and_tag;
# # Tag docker image as 'latest' if it is the master branch
# - if [ "$TRAVIS_BRANCH" == "master" ]; then
# docker tag ${DOCKER_IMAGE}:${TRAVIS_COMMIT} ${DOCKER_IMAGE}:latest;
# fi;
# Tag docker image with the git tag
# - if [ ! -z "$TRAVIS_TAG" ]; then
# docker tag ${DOCKER_IMAGE}:${TRAVIS_COMMIT} ${DOCKER_IMAGE}:${TRAVIS_TAG};
# fi;
- if [ "$TRAVIS_BRANCH" == "master" ]; then
make docker_build_and_tag;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push bossjones/boss-docker-jhbuild-pygobject3;
fi