forked from APSL/k8s-database-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis-build.sh
executable file
·27 lines (23 loc) · 1.04 KB
/
travis-build.sh
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
#! /bin/sh
# vim:set sw=8 ts=8 noet:
#
# Copyright (c) 2016-2017 Torchbox Ltd.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely. This software is provided 'as-is', without any express or implied
# warranty.
set -e
printf '####################################################################\n'
printf '>>> Building Docker image.\n\n'
make build TAG=$COMMIT
# If this is a release, push the Docker image to Docker Hub.
if [ "$TRAVIS_PULL_REQUEST" = "false" -a -n "$TRAVIS_TAG" ]; then
printf '####################################################################\n'
printf '>>> Creating release.\n\n'
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
docker tag torchbox/k8s-database-controller:$COMMIT torchbox/k8s-database-controller:$TRAVIS_TAG
docker push torchbox/k8s-database-controller:$TRAVIS_TAG
docker tag torchbox/k8s-database-controller:$COMMIT torchbox/k8s-database-controller:latest
docker push torchbox/k8s-database-controller:latest
fi