forked from devilbox/docker-ngrok
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
70 lines (58 loc) · 2.73 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
###
### 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: "iQ9JT1Nz7tgTlaG4iQG8PrI96Asge/rLpBaIlIRBRgKE9OSjfPDwdUQEQTOm0XstdompqUWtTdx2ffmcF7B5eEoYCBZR+I+UDmlRxPdCygo/um3SQKHXPYJs2Jb6XfQKgsNnp8PTrbvg95Ol8bjxBEM1ilS88gwZjBOL7l9B93vntV6ALMERioq6L5nuD7DHRKWAkRXAbXY6bBvS9wPZLp+KD84AoaVJfzOBFuwbh1inqQn2a9E1LAz3moyJt3IMLfoAiLWBM0kW/svLkMuXFoeHH2mslJGcDJEEF5YRdaP5HArtvTMdAwkJl3CEVtu2lhZlhxTDuoHjwTPXtTAFNRoGcQ/USB+rylaPfdunuECgo4bv7eR07ClaYX5o5HnNmxStZlPT+71d1wFncFSO/qbjA5OzMxlvIzMfPPcCwNlwdS4RVgzuezxD9mxvgLIHG7hasMpKfS5V6boSZxcj3blHAFrwW8I+c9EqhSgiFWaTfHj3wKcGfMUPfQdbjPoQVF5Zw9lJnT64azCAjY4xy6YMkc4oyIr1HOuBe3MeoyD++loIc3CmUqe2TWVbrbkhhQ/h40v+MJcgPLM4kHLlJZa1WTNYQRto50Pw+gixiEIUuKPUDUi4BucYG3AIlFnnOLyR2b/phC7TxQU8HRCLbPUwy3xS+M7NJgDHlIUKBPs="
# DOCKER_PASSWORD
- secure: "Vui8u1T8uviGn/aKWxWHEwphW3j6L0kfk+P6sFipuJPpCA9x0SDKmDjBaVeyoCO1r5PnzXLSLzG8yB4ylY+QWmlUIkJWI2iy96N1O2NyLDkG8mZs4+tC9dtHB9gMIxkcKK7udtsf/05tD/iPhsAv/a6SsyX/up/8oHfzn0exG34Ks6rwoXr8rZI8VoF37lZpidwHQyqxSejZ3aKrzquazHECtMIEc6X5DwMlPCPUEQPPQ8yavlJN0OFcQ/A7NH5vN0aDnd8YdwtaigAt0U62tRdQ0jLS3AUf7smfNDhhm4WdBmWzJnT4rwupzS2LnlXjfp6d6gSJ+eehwqhSuKLadzO9PISHOeb58YfDADV2n55/p0LkHt7zsVs28Xd9VXZol5pTCjf4RkGZeATENRQKOTvpvXcjCItbcWqGqkyDo8vALx2vU1ybpQB8UBxAZl05y2N8t0ZqSHU55k7ogMuTI5THS9zWFyIDlKjqtIw7l4vaE2M1w526OVm3W4QiPYBF2B+zJDE1/QYQYg3bhqjTcyJ2t4mt/OuXFbPFDoB3S3H8M85/8afZJHVG9Qlzb31gvyBYsHHkVYDFhyybaB4XGHC6cCBLS0YnTX6tUMt7RVoTEeXiliXOZQtgCc4nrGFx5cdbXLzPJsnGKdQPsQvb+DZfLilUihu0X7ArtpEr+KY="
###
### 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 [ -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