]> git.sur5r.net Git - i3/i3/blob - travis/docker-build-and-push.sh
travis/cleanup-bintray: use dpkg --compare-versions (#2453)
[i3/i3] / travis / docker-build-and-push.sh
1 #!/bin/sh
2
3 set -e
4
5 BASENAME=$1
6 DOCKERFILE=$2
7
8 # .dockerignore is created on demand so that release.sh and other scripts are
9 # not influenced by our travis setup.
10 echo .git > .dockerignore
11
12 docker build --pull --no-cache --rm -t=${BASENAME} -f ${DOCKERFILE} .
13 # For pull requests, travis does not add secure environment variables to the
14 # environment (because pull requests could then steal their values), so skip
15 # the login+push step when the variable isn’t set.
16 if [ -n "${DOCKER_PASS}" ]
17 then
18         docker login -e ${DOCKER_EMAIL} -u ${DOCKER_USER} -p ${DOCKER_PASS}
19         docker push ${BASENAME}
20 fi