Trigger Docker hub image on merge to master

This commit is contained in:
stianst 2018-08-20 09:04:06 +02:00 committed by Stian Thorgersen
parent 625f613128
commit 4cb9944067
2 changed files with 9 additions and 0 deletions

View file

@ -37,4 +37,7 @@ before_install:
script:
- ./travis-run-tests.sh $TESTS
after_success:
- .travis/docker-hub-master-trigger.sh
sudo: false

View file

@ -0,0 +1,6 @@
#!/bin/bash
if [ "$DOCKER_HUB_TOKEN" != "" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_REPO_SLUG" == "keycloak/keycloak" ]; then
curl -H "Content-Type: application/json" --data '{"docker_tag": "master"}' -X POST https://registry.hub.docker.com/u/jboss/keycloak/trigger/$DOCKER_HUB_TOKEN/
echo "Triggered Docker hub build"
fi