#!/bin/bash

set -ev

if [ "$TRAVIS_PHP_VERSION" != "7.1" ]; then
	echo "Skipping docker build on php7.0"
	exit 0;
fi

BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}
TAG=`if [ "$BRANCH" == "master" ]; then echo "latest"; else echo $BRANCH ; fi`

docker build -t weinstein/app:$TAG -f deploy/app.docker .
docker build -t weinstein/web:$TAG -f deploy/web.docker .

docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
docker push weinstein/app
docker push weinstein/web

#!/bin/bash

set -ev

if [ "$TRAVIS_PHP_VERSION" != "7.1" ]; then
	echo "Skipping docker build on php7.0"
	exit 0;
fi

BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}
TAG=`if [ "$BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_COMMIT ; fi`

docker build -t weinstein/app:$TAG -f deploy/app.docker .
docker build -t weinstein/web:$TAG -f deploy/web.docker .

docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
docker push weinstein/app
docker push weinstein/web

Use commit instead of branch name to tag docker image
Use commit instead of branch name to tag docker image

Signed-off-by: Christoph Wurst <7abde52c298496fa169fb750f91f213a282142af@winzerhof-wurst.at>
