2016-02-01 09:42:55 +01:00
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
2016-03-27 21:11:30 +02:00
|
|
|
|
BASENAME=$1
|
|
|
|
|
DOCKERFILE=$2
|
|
|
|
|
|
2016-02-01 09:42:55 +01:00
|
|
|
|
# .dockerignore is created on demand so that release.sh and other scripts are
|
|
|
|
|
# not influenced by our travis setup.
|
|
|
|
|
echo .git > .dockerignore
|
|
|
|
|
|
2016-03-27 21:11:30 +02:00
|
|
|
|
docker build --pull --no-cache --rm -t=${BASENAME} -f ${DOCKERFILE} .
|
2016-03-06 18:51:52 +01:00
|
|
|
|
# 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 -e ${DOCKER_EMAIL} -u ${DOCKER_USER} -p ${DOCKER_PASS}
|
|
|
|
|
docker push ${BASENAME}
|
|
|
|
|
fi
|