Skip to content

Commit

Permalink
Build release builds off tags starting with "release/"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Collins committed Oct 7, 2019
1 parent 7fe21d4 commit f5ccc9c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ plugins {
id 'maven-publish'
}

def releaseVersion = '0.99.0'
def releaseBuild = false;

if (System.getenv('TRAVIS_BRANCH') && System.getenv('TRAVIS_PULL_REQUEST') == 'false') {
defaultTasks 'build', 'publish'

releaseBuild = System.getenv('TRAVIS_BRANCH').startsWith("release/");
} else {
defaultTasks 'build', 'publishToMavenLocal'
}

group = 'gyro'
version = '0.99.0-SNAPSHOT'
version = releaseBuild ? releaseVersion : releaseVersion + '-SNAPSHOT'

java {
sourceCompatibility = JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -92,11 +96,11 @@ publishing {
password System.getenv('GRADLE_DEPLOY_PASSWORD')
}

if (project.version.endsWith('-SNAPSHOT')) {
url 'https://artifactory.psdops.com/gyro-snapshots'
if (releaseBuild) {
url 'https://artifactory.psdops.com/gyro-releases'

} else {
url 'https://artifactory.psdops.com/gyro-releases'
url 'https://artifactory.psdops.com/gyro-snapshots'
}
}
}
Expand Down

0 comments on commit f5ccc9c

Please sign in to comment.