From ad56a6c983692f4b9e3dfb4059fd27151f298302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Sun, 17 Sep 2017 02:15:22 +0200 Subject: [PATCH] added trigger to build docker image on travis --- .travis.yml | 4 +++- contrib/travis-ci.org/trigger-docker-build.sh | 18 ++++++++++++++++++ .../trigger-docker-compose-build.sh | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 contrib/travis-ci.org/trigger-docker-build.sh diff --git a/.travis.yml b/.travis.yml index e3cfaaa1e..ea8e7fed6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,4 +55,6 @@ script: - ruby -I test/ test/integration/user_device_controller_test.rb - ruby -I test/ test/integration/sipgate_controller_test.rb - rake db:drop -after_success: contrib/travis-ci.org/trigger-docker-compose-build.sh +after_success: + - contrib/travis-ci.org/trigger-docker-build.sh + - contrib/travis-ci.org/trigger-docker-compose-build.sh diff --git a/contrib/travis-ci.org/trigger-docker-build.sh b/contrib/travis-ci.org/trigger-docker-build.sh new file mode 100644 index 000000000..c33035098 --- /dev/null +++ b/contrib/travis-ci.org/trigger-docker-build.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# +# trigger build of https://github.com/zammad/zammad on https://travis-ci.org/zammad/zammad and upload it to https://hub.docker.com/r/zammad/zammad +# + +REPO_USER="zammad" +REPO="zammad" +BRANCH="develop" + +if [ "${TRAVIS_BRANCH}" == 'develop' ]; then + curl -X POST \ + -H "Content-Type: application/json" \ + -H "Travis-API-Version: 3" \ + -H "Accept: application/json" \ + -H "Authorization: token ${TRAVIS_API_TOKEN}" \ + -d '{"request": {"branch":"'${BRANCH}'"}}' \ + "https://api.travis-ci.org/repo/${REPO_USER}%2F${REPO}/requests" +fi diff --git a/contrib/travis-ci.org/trigger-docker-compose-build.sh b/contrib/travis-ci.org/trigger-docker-compose-build.sh index cc7288b49..d539b6fed 100755 --- a/contrib/travis-ci.org/trigger-docker-compose-build.sh +++ b/contrib/travis-ci.org/trigger-docker-compose-build.sh @@ -7,7 +7,7 @@ REPO_USER="zammad" REPO="zammad-docker-compose" BRANCH="master" -if [ ${TRAVIS_BRANCH} == 'stable' ]; then +if [ "${TRAVIS_BRANCH}" == 'stable' ]; then curl -X POST \ -H "Content-Type: application/json" \ -H "Travis-API-Version: 3" \