Change build script to build latest release versions if not in CI (#115)
Build.sh can build the latest versions of the images using the VERSION file under the two repos (core & web).
This commit is contained in:
@@ -1,4 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
|
|
||||||
docker push maxking/mailman-web
|
if [[ "$TRAVIS_BRANCH" == "master" ]]
|
||||||
docker push maxking/mailman-core
|
then
|
||||||
|
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
|
||||||
|
docker push maxking/mailman-web
|
||||||
|
docker push maxking/mailman-core
|
||||||
|
else
|
||||||
|
echo "Non-master branch aren't pushed to DockerHub..."
|
||||||
|
fi
|
||||||
|
|||||||
18
build.sh
18
build.sh
@@ -4,13 +4,21 @@ set -e
|
|||||||
|
|
||||||
# Use this script to build docker images.
|
# Use this script to build docker images.
|
||||||
|
|
||||||
if [ "$TRAVIS_BRANCH" = "master" ]; then
|
if [[ "$TRAVIS" ]]
|
||||||
TAG="latest"
|
then
|
||||||
|
if [ "$TRAVIS_BRANCH" = "master" ]; then
|
||||||
|
CORE_TAG="latest"
|
||||||
|
WEB_TAG="latest"
|
||||||
|
else
|
||||||
|
CORE_TAG="$TRAVIS_BRANCH"
|
||||||
|
WEB_TAG="$TRAVIS_BRANCH"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
TAG="$TRAVIS_BRANCH"
|
CORE_TAG=`cat core/VERSION`
|
||||||
|
WEB_TAG=`cat web/VERSION`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DOCKER=docker
|
DOCKER=docker
|
||||||
|
|
||||||
$DOCKER build -t maxking/mailman-core:$TAG core/
|
$DOCKER build -t maxking/mailman-core:$CORE_TAG core/
|
||||||
$DOCKER build -t maxking/mailman-web:$TAG web/
|
$DOCKER build -t maxking/mailman-web:$WEB_TAG web/
|
||||||
|
|||||||
1
core/VERSION
Normal file
1
core/VERSION
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0.1.1
|
||||||
1
web/VERSION
Normal file
1
web/VERSION
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0.1.1
|
||||||
Reference in New Issue
Block a user