Skip to content

Commit

Permalink
Merge pull request #125 from datacite/travis
Browse files Browse the repository at this point in the history
push pull requests to docker hub
  • Loading branch information
Martin Fenner authored Oct 27, 2018
2 parents 9c43b8d + 7f05458 commit 47094e5
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 47094e5

Please sign in to comment.