diff --git a/.travis.yml b/.travis.yml index 93c025e23..2735eacaf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,6 +38,7 @@ stages: - 'Full stack production tests' - 'Test' - 'Publish' + - 'Snapshot' jobs: include: @@ -83,3 +84,9 @@ jobs: script: - ./gradlew ship after_success: skip + + - stage: 'Snapshot' + if: env(SNAPSHOT) = true and type = api + script: + - TRAVIS_TAG=BB-SNAPSHOT ./gradlew ship + after_success: skip diff --git a/build.gradle b/build.gradle index 31608bcbf..e0e14fa9d 100644 --- a/build.gradle +++ b/build.gradle @@ -27,6 +27,8 @@ allprojects { if (travis_defined_version != null) { version = travis_defined_version } + + ext.isReleaseVersion = !version.endsWith("SNAPSHOT") } def publishedProjects = subprojects.findAll { it.name != 'java-quickstart' } @@ -127,7 +129,9 @@ configure(publishedProjects) { } repositories { maven { - url "https://oss.sonatype.org/service/local/staging/deploy/maven2" + def releaseUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2" + def snapshotUrl = "https://oss.sonatype.org/content/repositories/snapshots" + url = isReleaseVersion ? releaseUrl : snapshotUrl credentials { username System.getenv('MAVEN_CENTRAL_USERNAME') password System.getenv('MAVEN_CENTRAL_PASSWORD')