-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
75 lines (63 loc) · 2.97 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
###
### Enable sudo (required for docker service)
###
sudo: required
###
### Language
###
language: python
###
### Add services
###
services:
- docker
###
### Build Matrix definition
###
env:
global:
# travis encrypt DOCKER_USERNAME=user
# travis encrypt DOCKER_PASSWORD=pass
# Must be regenerated when repository name/owner changes
# DOCKER_USERNAME
- secure: "QxqkQXvzJ27VO3A8xfli0MSAUBP64mkiCD9/owJNdKY2XsBlvnIgCuqiFhRqeuL/lqQdcNRUNp3HOrVY3aLujhPDePJssSoBXErRJmsgqsBZMy3ilV2woIqfgG9pu+jSEhvPj05xxE/OaVkiuLr14qfDIfnt9quZlI5/I2eZTTo2I6y74EDFcCFfBEoPRx4JYx4A8mDU9a+h5JcRomGMq7RBNo+ebKWf0HzDK+0W4hAf/BgIGvIMfA+9H7YKJCePNjB7mnfkSVVBAWdYB560iIxRbajIxObQvBI00b9V1KNC37U3PejoeCojyFErsttlQjFvlP2cDo/O+aBL+nbgyEduaOkW287iGzihQncF585n+iFqlAiVi0r+ozWqiOIszjd0amj5Gt54w8+UY7xEk7DNOLB2yP/qfKafrKDua0GXWG03cdH/nPWZg1JkHdc8is/ZcAholkcsok/y8B6Nhcwa55wtFnknPwtS6ZRoykxBzychB0Aoawpajc3S3zCF9sj6gPbLwm5TiLULkungBdorOkP00i/ZAK/kGu/uVUxOx11sbYWojdx3eOyO3GGVodRjU63CxitCgH7cD1PJdAifTUPRA6KHtCvYXNKr/WKEy37Bv20tLR89IQQh5QkBwv67/xyfbw5IQsVlMuWVZITelUir2sFmCBP05Qc9mEY="
# DOCKER_PASSWORD
- secure: "mRN/4Sj5OkVliHbExsL7lIJlceJvJZUFEliFBUtXwRW6ndNNmSWHB4C9B0Czjws/pgIcAUgrC4/g63i/q1vGDs+cU3d82ZlBOjwx65HN7FDqzAZT/LT4A7Z16rALJd/c8tA98M8GqZvwmQpYNavwKm4V8xtL1sKfq9yTll7U/WgCxu4UYLnZgl4axRX1n4oA6+fCiFv7+h3EN49DGqMP0oUhp9xbRzKjI3uiv3oixmXRDEIvvSPyqb7/IXdY9dSmtqw3HhwpEjpy7q8qYYwZRhAHe3LeSuTKxdajrUzYTR9D13BTHGXTAJOwtw5neb0lz14LwsTNqBUYUzY1YlCAsudy5id4JK8RjlKR8pvNhfHlVbaBzwotydnpC19snAVrCOLRXVGD2rfgVF0RIxv2aOP6jyd01XxCkAmLsTxi1nDz4kZLZTf7WgEyrM7448xFC3bPb7PT8/gG6rsFhfJKYQobZgCOnFp5B0E88bMYl0546e+w+XgwzaXErOuWgYz3zTVxClKO/XteZ91HayjJD/l6JmTy93yD84UxFPAqyh7sFcxgGDeRsqsUYvI0tWvyoICHPwwJXejfbC3gmUQPN64NUPWAzLPNdM8cqykK4msmJBNs/mFdxIYvDuV2pZjwZK3aU3PQEXrNcXC/xslS9fC16aoj725wm5L7AUIERzY="
###
### Global for all stages
###
install:
# Get newer docker version
- max=100; i=0; while [ $i -lt $max ]; do if sudo apt-get update; then break; else i=$((i+1)); fi done
- max=100; i=0; while [ $i -lt $max ]; do if sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce; then break; else i=$((i+1)); fi done
- docker version
###
### Build and test
###
before_script:
- make build
- make test
###
### Push to Dockerhub
###
script:
# Push to docker hub on success
- if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
make login USER="${DOCKER_USERNAME}" PASS="${DOCKER_PASSWORD}";
if [ "${TRAVIS_BRANCH}" == "master" ]; then
make push;
elif [[ ${TRAVIS_BRANCH} =~ ^(release-[.0-9]+)$ ]]; then
make push TAG="${TRAVIS_BRANCH}";
elif [ -n "${TRAVIS_TAG}" ]; then
make push TAG="${TRAVIS_TAG}";
elif [ "${TRAVIS_EVENT_TYPE}" = "cron" ]; then
if MY_TAG="$( git describe --exact-match "$(git rev-parse HEAD)" 2>/dev/null )"; then
echo "Pushing cron tag ${MY_TAG}";
make push TAG="${MY_TAG}";
fi
else
echo "Skipping branch ${TRAVIS_BRANCH}";
fi
else
echo "Skipping push on PR";
fi