#!/bin/bash

set -ev

if [ "$TRAVIS_BRANCH" != "master" ] || [ $TRAVIS_PHP_VERSION != "7.1" ]; then 
	exit 0;
fi

docker build -t weinstein/app -f deploy/app.docker .
docker build -t weinstein/web -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.0" ]; then
	echo "Skipping docker build on php7.0"
	exit 0;
fi

TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`

docker build -t weinstein/app -f deploy/app.docker .
docker build -t weinstein/web -f deploy/web.docker .

docker tag weinstein/app weinstein/app:$TAG
docker tag weinstein/web weinstein/web:$TAG

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


Build docker images on all branches and tag them accordingly
Build docker images on all branches and tag them accordingly

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