-
Notifications
You must be signed in to change notification settings - Fork 7
/
.travis.yml
69 lines (59 loc) · 1.24 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
---
###
### Travis settings
###
sudo: required
language: minimal
services:
- docker
###
### Build Matrix
###
env:
matrix:
- PYTHON=3.8
- PYTHON=3.7
- PYTHON=3.6
- PYTHON=3.5
- PYTHON=2.7
###
### Install requirements
###
install:
- docker version
- netstat -tulpn
- retry() {
for ((n=0; n<10; n++)); do
echo "[${n}] ${*}";
if eval "${*}"; then
return 0;
fi;
sleep 1;
done;
return 1;
}
###
### Check generation changes, build and test
###
before_script:
- retry make build PYTHON=${PYTHON}
- retry make test PYTHON=${PYTHON}
###
### Push to Dockerhub
###
script:
# Push to docker hub on success
- if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
retry make login USER="${DOCKER_USERNAME}" PASS="${DOCKER_PASSWORD}";
if [ -n "${TRAVIS_TAG}" ]; then
retry make push TAG="${PYTHON}-dev-${TRAVIS_TAG}";
elif [ "${TRAVIS_BRANCH}" == "master" ]; then
retry make push TAG="${PYTHON}-dev";
elif [[ ${TRAVIS_BRANCH} =~ ^(release-[.0-9]+.*)$ ]]; then
retry make push TAG="${PYTHON}-dev-${TRAVIS_BRANCH}";
else
echo "Skipping branch ${TRAVIS_BRANCH}";
fi
else
echo "Skipping push on PR";
fi