Skip to content

Commit

Permalink
tell travis to push to pull request branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Oct 27, 2018
1 parent 94dbbb0 commit 7f05458
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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:
Expand Down

0 comments on commit 7f05458

Please sign in to comment.