Adjust publish logic to adhere to Travis spec

See the specifics here: http://docs.travis-ci.com/user/ci-environment/#Environment-variables
This commit is contained in:
Seth Goings 2015-01-10 16:53:52 -07:00
parent 610f3a62ae
commit 394c5cacce

View File

@ -244,7 +244,9 @@ publishing {
artifactoryPublish {
onlyIf {
System.env.'TRAVIS_BRANCH' == "master" && !System.env.'TRAVIS_PULL_REQUEST'.toBoolean()
// TRAVIS_BRANCH reports master if it is a master build or a PR going to master
// TRAVIS_PULL_REQUEST reports false if not a pull request and the PR number if it is
System.env.'TRAVIS_BRANCH' == "master" && System.env.'TRAVIS_PULL_REQUEST' == "false"
}
dependsOn assemble
}
@ -278,4 +280,4 @@ artifactory {
task wrapper(type: Wrapper) {
distributionUrl = 'http://services.gradle.org/distributions/gradle-2.0-bin.zip'
}
}