Skip to content

Commit 70a42c6

Browse files
authored
chore: add snapshot publish to travis (#442)
1 parent 803103f commit 70a42c6

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ stages:
3838
- 'Full stack production tests'
3939
- 'Test'
4040
- 'Publish'
41+
- 'Snapshot'
4142

4243
jobs:
4344
include:
@@ -83,3 +84,9 @@ jobs:
8384
script:
8485
- ./gradlew ship
8586
after_success: skip
87+
88+
- stage: 'Snapshot'
89+
if: env(SNAPSHOT) = true and type = api
90+
script:
91+
- TRAVIS_TAG=BB-SNAPSHOT ./gradlew ship
92+
after_success: skip

build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ allprojects {
2727
if (travis_defined_version != null) {
2828
version = travis_defined_version
2929
}
30+
31+
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
3032
}
3133

3234
def publishedProjects = subprojects.findAll { it.name != 'java-quickstart' }
@@ -127,7 +129,9 @@ configure(publishedProjects) {
127129
}
128130
repositories {
129131
maven {
130-
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
132+
def releaseUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
133+
def snapshotUrl = "https://oss.sonatype.org/content/repositories/snapshots"
134+
url = isReleaseVersion ? releaseUrl : snapshotUrl
131135
credentials {
132136
username System.getenv('MAVEN_CENTRAL_USERNAME')
133137
password System.getenv('MAVEN_CENTRAL_PASSWORD')

0 commit comments

Comments
 (0)