-
Notifications
You must be signed in to change notification settings - Fork 14
/
.travis.yml
37 lines (30 loc) · 1.19 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
# 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 docker --version
- sudo pip install requests # for latest.py
script:
- sudo ./test_runner.sh
after_success:
- REPO=higlass/higlass-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