-
Notifications
You must be signed in to change notification settings - Fork 19
/
.travis.yml
72 lines (60 loc) · 2.83 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
###
### 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: "iJrEdQr7FAx07nmkgJTOlArYv1/quYmyLBTjqrM6xg1RwzQoPLK2xyz4/RHumublntXHUNi/wmdPBjctxKzL9Yd5CUExoa2h36K0SeyrZwb/5ksMSu4UxlKciT7XQMIUJr1Mcl7ru++uW+PAsnj3jdaz0ybq2woyI9/Nd367YoAxFD3lT6EbgnYQFe7yti/FBkFa/uiIalZSa+7FRo6fm0Y8KynNwYCkY22lGPjrXiepUsGPak+V8BIuDeqaIDRbrYQNY5SexSAZoOoNtY20ayLgx57n+ZMmyW+O3tQWLX0efeiwW6bLsBLCnN5y4VBuH41/J7T3UQEVEMPWaadGJCW8iJdF+wyaArhggZNFBwCPdoBUAfY4+psefRX2PO+YPemcMrfV5An5BPMIEwagLhSbdYf4TDMi8TLWq6JrIfxPFKtl8cbwG/FPdBCJLrG1yT6d0A581lVGdcKzn2HOi3YnO9/Wf/S8nqYx7C0N6m837DogWLO56L9kBx2Ne/mtsO9+wRuEMUlxmYuF/cCK7o7ZdnJ/m/DQhdTDSLLnaKV99a90chxsaKh/yjXcCaC5vFQppptBcMHOM5qg0aWmDzkShV3RXpcoLvSpVRHe7wMKOIL/XleokFLZ9Zod/W4dIh8fmsYNd2Xesg6pHQ8+HenFouWj4Qsm14CzBjvRzbE="
# DOCKER_PASSWORD
- secure: "pi7Xnn7Jd8NAZzRuNi+lbVuDO76rt/6elu74Su19UUZvCH6ZFIyXhW5EZcmKQzs7i5zEWef+9C6EpFK5ZkiNrFiXA7msEv97qVU51I91/DhpNYuQVQ9823oGadleX2rAl4IughH98LmHWeDflAH7XERdSx5Su9QWii57HeBVodY2/zoISyiNfDWlaj5MgUeddWELSQHEmpXAZOF/EpLyku9fAMYEGhQclzaxI+WvUS1QREQ7b4DVV+b9cVK62GmqYGskwJc8IoYmYYRRf47LcfOUotBLYfWRw4nRfue0ta8oi4BAUOwnA8f4ATFAoBZoJC39CPPDqOiGjbLSIR8TIEeNVSUzBHrb21OoyH4X3o8MZ7YBjeMBhyzclf1x/9y2jhFEGEp8SDlP4Y3yTOnXPwTNHehhUwqLep4BnuIMDlXLC/L44jC/ETNAyznd2ABCtUEHYTCEDC7eWqCnPOiGI+01+1dovU/0LHXa+lmYVk1OdZCADFDPtDrYdnLF50HcYAp/M2RvRyxbOwkFsND3hyDldjmDF9SX6CXX1+2fzXu7GjDZX7LDA8atWL5qHJWGrl+/Dbv4b7oaB0igcidJljGxIV6IjOEB8lOsimGA3zwioAV2olg2hG8i8vM3BD64ntw3ZKmRN/Q67IFQSAr6zssN6xg8SiezTE4NiEfy1eY="
###
### 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
- make update-readme
- git diff --quiet || { echo "Build Changes"; git diff; git status; false; }
###
### 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 [ -n "${TRAVIS_TAG}" ]; then
make push TAG="${TRAVIS_TAG}";
elif [ "${TRAVIS_BRANCH}" == "master" ]; then
make push;
elif [[ ${TRAVIS_BRANCH} =~ ^(release-[.0-9]+)$ ]]; then
make push TAG="${TRAVIS_BRANCH}";
else
echo "Skipping branch ${TRAVIS_BRANCH}";
fi
else
echo "Skipping push on PR";
fi