Codebase list i3-gaps / 6a2b3a6f-3889-47b0-9491-b7d0979eabd0/upstream travis / docker-build-and-push.sh
6a2b3a6f-3889-47b0-9491-b7d0979eabd0/upstream

Tree @6a2b3a6f-3889-47b0-9491-b7d0979eabd0/upstream (Download .tar.gz)

docker-build-and-push.sh @6a2b3a6f-3889-47b0-9491-b7d0979eabd0/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