-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
41 lines (34 loc) · 1.4 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
# Docker on Travis requires sudo.
sudo: required
install:
# Docker 1.13 adds "--cache-from" which really speeds up our Travis builds.
# Travis is currently several versions behind: When/if they catch up,
# this can all go away, and we can stop sudoing docker.
- sudo apt-get install libapparmor1
- DEB=docker-engine_1.13.0-0~ubuntu-precise_amd64.deb
- wget https://apt.dockerproject.org/repo/pool/main/d/docker-engine/$DEB
- sudo dpkg -i $DEB
- sudo docker --version
- sudo pip install -r requirements.txt # for latest.py
script:
- sudo ./test_runner.sh
after_success:
- REPO=scottx611x/refinery-jupyter-docker
- IMAGE=`sudo docker ps --latest --format '{{ .Image }}'` # TODO: with more containers, can't rely on ordering
- tag_push() { echo "Tagging into $2"; sudo docker tag $1 $2; sudo docker push $2; }
- sudo docker login -u $DOCKER_USER -p $DOCKER_PASS
# Always update "latest": the cache will be used for the next build.
- tag_push $IMAGE $REPO
- >
if [ "$TRAVIS_EVENT_TYPE" == "pull_request" ]; then
echo "PR!";
BRANCH=`echo ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} | perl -pne 'chomp;s{.*/}{};s/\W/-/g'`;
tag_push $IMAGE $REPO:$BRANCH;
tag_push $IMAGE $REPO:latest-pr;
fi
- >
if [ ! -z "$TRAVIS_TAG" ]; then
echo "Git tag!";
tag_push $IMAGE $REPO:$TRAVIS_TAG;
tag_push $IMAGE $REPO:latest;
fi