Codebase list i3-gaps / f9eeaa1c-77c8-48dd-b057-f95dc8b1f8eb/upstream travis / docker-build-and-push.sh
f9eeaa1c-77c8-48dd-b057-f95dc8b1f8eb/upstream

Tree @f9eeaa1c-77c8-48dd-b057-f95dc8b1f8eb/upstream (Download .tar.gz)

docker-build-and-push.sh @f9eeaa1c-77c8-48dd-b057-f95dc8b1f8eb/upstreamraw · history · blame

#!/bin/sh

set -e

BASENAME=$1
DOCKERFILE=$2

docker build --pull --no-cache --rm -t=${BASENAME} -f ${DOCKERFILE} .
# For pull requests, travis does not add secure environment variables to the
# environment (because pull requests could then steal their values), so skip
# the login+push step when the variable isn’t set.
if [ -n "${DOCKER_PASS}" ]
then
	docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}
	docker push ${BASENAME}
fi