From 7f05458eee6fa3a01592d104ce1923e1a86ba5ed Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Sat, 27 Oct 2018 15:50:03 +0200 Subject: [PATCH] tell travis to push to pull request branch --- .travis.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index e81d5ed9d..2f0228202 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,16 +52,16 @@ after_success: docker push $REPO:$TRAVIS_TAG; echo "Pushed to" $REPO:$TRAVIS_TAG; AUTO_DEPLOY=true; - elif [ "$TRAVIS_BRANCH" == "master" ]; then - docker build -f Dockerfile -t $REPO .; - docker push $REPO; - echo "Pushed to" $REPO; - AUTO_DEPLOY=true; elif [ "$TRAVIS_PULL_REQUEST" == "true" ]; then docker build -f Dockerfile -t $REPO:$TRAVIS_PULL_REQUEST_BRANCH .; docker push $REPO:$TRAVIS_PULL_REQUEST_BRANCH; echo "Pushed to" $REPO:$TRAVIS_PULL_REQUEST_BRANCH; AUTO_DEPLOY=true; + elif [ "$TRAVIS_BRANCH" == "master" ]; then + docker build -f Dockerfile -t $REPO .; + docker push $REPO; + echo "Pushed to" $REPO; + AUTO_DEPLOY=true; else docker build -f Dockerfile -t $REPO:$TRAVIS_BRANCH .; docker push $REPO:$TRAVIS_BRANCH; @@ -88,12 +88,17 @@ after_success: if [ "${TRAVIS_TAG?}" ]; then git add prod-eu-west/services/client-api/_lupo.auto.tfvars; + git commit -m "Adding lupo git variables for commit tagged ${TRAVIS_TAG?}"; + git push "https://${TRAVIS_SECURE_TOKEN}@github.com/datacite/mastino.git" master; + elif [ "$TRAVIS_PULL_REQUEST" == "true" ]; then + git add stage/services/client-api/_lupo.auto.tfvars; + git commit -m "Adding lupo git variables for pull request #${TRAVIS_PULL_REQUEST}"; + git push "https://${TRAVIS_SECURE_TOKEN}@github.com/datacite/mastino.git" ${TRAVIS_PULL_REQUEST_BRANCH}; else git add stage/services/client-api/_lupo.auto.tfvars; + git commit -m "Adding lupo git variables for latest commit"; + git push "https://${TRAVIS_SECURE_TOKEN}@github.com/datacite/mastino.git" master; fi - - git commit -m "Adding lupo git variables for latest commit"; - git push "https://${TRAVIS_SECURE_TOKEN}@github.com/datacite/mastino.git"; fi notifications: