Fix branch name env var

This commit is contained in:
Roman Mandeleil 2015-03-27 12:38:05 +03:00
parent 1fb2e0af0c
commit 114595bb01
1 changed files with 3 additions and 3 deletions

View File

@ -136,6 +136,7 @@ jacocoTestReport {
def bintrayUsername = project.hasProperty('bintrayUser') ? project.bintrayUser : ''
def bintrayPassword = project.hasProperty('bintrayKey') ? project.bintrayKey : ''
def pullRequest = System.getenv('TRAVIS_PULL_REQUEST')
def branchName = System.getenv('TRAVIS_BRANCH')
artifactory {
contextUrl = 'http://oss.jfrog.org/artifactory'
@ -156,8 +157,7 @@ artifactory {
artifactoryPublish.onlyIf {
(!pullRequest || pullRequest == 'false') &&
project.version.endsWith('-SNAPSHOT') && (buildEnv.branch.startsWith('master'))
project.version.endsWith('-SNAPSHOT') && (branchName.startsWith('master'))
}
bintray {
@ -187,7 +187,7 @@ install {
task publish {
println "publishing if master current branch: " + buildEnv.branch
println "publishing if master current branch: " + branchName
description = "Publishes snapshots to oss.jfrog.org and releases to Bintray/JCenter"
dependsOn artifactoryPublish, bintrayUpload
}