-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
39 lines (34 loc) · 1.59 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
sudo: required
env:
- VERSION=1.0
services:
- docker
before_install:
- docker build -t nanobox/influxdb ./$VERSION
- docker tag nanobox/influxdb nanobox/influxdb:$VERSION
script: sudo test/run_all.sh $VERSION
after_success:
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
- "echo \"Branch: '$BRANCH'; Version: '$VERSION'\";"
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
- docker build -t ${NAMESPACE}/influxdb ./${VERSION};
# `$VERSION-beta` tag is always pushed (master or any dev branch)
- docker tag ${NAMESPACE}/influxdb ${NAMESPACE}/influxdb:${VERSION}-beta;
- docker push ${REMOTE}${NAMESPACE}/influxdb:${VERSION}-beta;
# `beta` tag is always pushed (master or any dev branch)
- if [ "$VERSION" == "1.0" ]; then
docker tag ${NAMESPACE}/influxdb ${NAMESPACE}/influxdb:beta;
docker push ${REMOTE}${NAMESPACE}/influxdb:beta;
fi
# `latest` tag is only pushed on master && most recent version
- if [ "$BRANCH" == "master" ] && [ "$VERSION" == "1.0" ]; then
docker push ${REMOTE}${NAMESPACE}/influxdb;
fi
# `$VERSION` (latest/stable implied) tag is only pushed on master. tag branch for clarity otherwise (`$VERSION-$BRANCH`)
- if [ "$BRANCH" == "master" ]; then
docker tag ${NAMESPACE}/influxdb ${NAMESPACE}/influxdb:${VERSION};
docker push ${REMOTE}${NAMESPACE}/influxdb:${VERSION};
else
docker tag ${NAMESPACE}/influxdb ${NAMESPACE}/influxdb:${VERSION}-${BRANCH//\//_};
docker push ${REMOTE}${NAMESPACE}/influxdb:${VERSION}-${BRANCH//\//_};
fi