silverstripe / sspak

Tool for managing bundles of db/assets from Silverstripe environments
http://silverstripe.github.io/sspak/
BSD 3-Clause "New" or "Revised" License
47 stars 34 forks source link

FIX Travis tests to work on PRs #43

Closed dhensby closed 8 years ago

dhensby commented 8 years ago

At the moment the travis script isn't meant for PRs, this change will allow us to run tests on PRs and publish the binary on merge.

sminnee commented 8 years ago

What happens if you upload a feature branch to this repo? I think that we only want to run this code on the master branch, rather than suppress it only for pull request builds. Is that right?

dhensby commented 8 years ago

@sminnee that's a good point - yes, if a feature branch is created travis will currently build to gh-pages

we can use $TRAVIS_BRANCH for determining the branch - this needs to be used in conjunction with the pull request test too

From https://docs.travis-ci.com/user/environment-variables/ :

For builds not triggered by a pull request this is the name of the branch currently being built; whereas for builds triggered by a pull request this is the name of the branch targeted by the pull request (in many cases this will be master).

sminnee commented 8 years ago

So these conditionals should be probably be [ "${TRAVIS_PULL_REQUEST}" = "false" -a "${TRAVIS_BRANCH}" = "master" ] then?

dhensby commented 8 years ago

Yep

sminnee commented 8 years ago

I added my suggestion as a 2nd commit.