Skip to content

Commit

Permalink
Fix for skipping push to dockerhub from travis jobs on PRs (#875)
Browse files Browse the repository at this point in the history
Correctly skip builds on forks by checking the value of TRAVIS_PULL_REQUEST variable.
  • Loading branch information
ivotron committed Jul 4, 2020
1 parent 1d7daf2 commit 432c283
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .popper.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
steps:
- id: skip if not in master branch, docker, and python3.7
- id: skip on forks
uses: docker://docker:19.03.3
runs: [sh, -ec]
secrets: [ENGINE, TRAVIS_PYTHON_VERSION]
runs: [sh, -exc]
secrets: [ENGINE, TRAVIS_PYTHON_VERSION, TRAVIS_PULL_REQUEST]
args:
- |
# only run on master, docker and python 3.7
if [ "$GIT_BRANCH" != "master" ] || [ "$ENGINE" != "docker" ] || [ "$TRAVIS_PYTHON_VERSION" != "3.7" ] ; then
# skip if this is a build for a PR
# for the rest, only continue if build:
# 1. is for upstream (getpopper/popper) repo
# 2. corresponds to the docker,python-3.7 element of the matrix
if [[ $TRAVIS_PULL_REQUEST != false ]] || [[ $GIT_REMOTE_ORIGIN_URL != "https://github.com/getpopper/popper.git" ]] || [[ $GIT_BRANCH != "master" ]] || [[ $ENGINE != "docker" ]] || [[ $TRAVIS_PYTHON_VERSION != "3.7" ]]; then
exit 78
fi
Expand Down
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ cat > ./popper << "EOF"
printenv > /tmp/.envfile
docker run --rm -ti \
--volume /tmp:/tmp \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume $PWD:$PWD \
--workdir $PWD \
Expand Down

0 comments on commit 432c283

Please sign in to comment.