diff --git a/.travis.yml b/.travis.yml index 36ef16fc4..2f0228202 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,6 +52,11 @@ after_success: docker push $REPO:$TRAVIS_TAG; echo "Pushed to" $REPO:$TRAVIS_TAG; 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; @@ -83,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" master; fi notifications: