Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit 065db79

Browse files
committed
Upgrade build script for snapshot deployments
1 parent e1ff034 commit 065db79

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

build.gradle

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ plugins {
2121
id "com.jfrog.bintray" version "$LIB_BINTRAY_PLUGIN_VER" apply false
2222
id 'net.researchgate.release' version "$LIB_RELEASE_PLUGIN_VER"
2323
id "org.springframework.boot" version "$LIB_SPRING_BOOT_VER" apply false
24+
id "com.jfrog.artifactory" version "4.15.1" apply false
2425
}
2526

2627
subprojects {
@@ -154,6 +155,30 @@ subprojects {
154155
}
155156
}
156157
}
158+
159+
artifactory {
160+
contextUrl = 'http://oss.jfrog.org'
161+
publish {
162+
repository {
163+
if (project.version.endsWith("-SNAPSHOT")) {
164+
repoKey = 'oss-snapshot-local'
165+
} else {
166+
repoKey = 'oss-release-local'
167+
}
168+
username = System.env.BINTRAY_USER ?: project.findProperty('BINTRAY_USER') ?: ''
169+
password = System.env.BINTRAY_PASS ?: project.findProperty('BINTRAY_PASS') ?: ''
170+
}
171+
defaults {
172+
publications('mainProjectPublication')
173+
publishArtifacts = true
174+
publishPom = true
175+
}
176+
}
177+
resolve {
178+
repoKey = 'oss-snapshot-local'
179+
}
180+
clientConfig.info.setBuildNumber(System.getProperty('build.number'))
181+
}
157182
}
158183
}
159184

travis-build.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@ EOL
1414
chmod 600 $HOME/.netrc
1515
}
1616

17-
if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ] && [ "${RELEASE}" = "true" ]; then
17+
if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ]; then
18+
if [ "${RELEASE}" = "true" ]; then
1819
echo "Deploying release to Bintray"
1920
saveGitCredentials
20-
git checkout -f ${TRAVIS_BRANCH}
2121
./gradlew clean assemble && ./gradlew check --info && ./gradlew bintrayUpload -x check --info
22+
else
23+
echo "Deploying snapshot"
24+
saveGitCredentials
25+
./gradlew artifactoryPublish -Dsnapshot=true -Dbuild.number="${TRAVIS_BUILD_NUMBER}"
26+
fi
2227
else
2328
echo "Verify"
2429
./gradlew clean assemble && ./gradlew check --info

0 commit comments

Comments
 (0)