Push to dockerhub on successful builds.

If master builds successfully then push the results
to dockerhub.

We assume that the dockerhub username and password will
be in the environment. This will use travis env vars so
that the secrets aren't available to forks.

The on: branch: master means that other branches wouldn't
push to dockerhub.
This commit is contained in:
James Westby 2016-09-09 14:47:50 +01:00
parent 82ca442105
commit 0930a29d6f
2 changed files with 10 additions and 0 deletions

View File

@ -6,3 +6,9 @@ services:
before_install:
- sudo apt-get -qq update
- sudo apt-get install -y debian-archive-keyring debootstrap
deploy:
provider: script
script: pushall
skip_cleanup: true
on:
branch: master

View File

@ -6,6 +6,10 @@ unstable
BASENAME=jamesw/minideb
if [ -n "$DOCKER_PASSWORD" ]; then
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
fi
for DIST in $DISTS; do
docker push $BASENAME:$DIST
done