Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit b0d3f57

Browse files
authored
Merge pull request #463 from SameeraPriyathamTadikonda/dev
DEVO-718: Publishing artifacts to nexus
2 parents 254b90b + 86b517e commit b0d3f57

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

Jenkinsfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@ pipeline{
2525
'''
2626
junit '**/build/**/*.xml'
2727
}
28+
}
29+
stage('publish'){
30+
when {
31+
branch 'develop'
32+
33+
}
34+
steps{
35+
sh label:'publish', script: '''#!/bin/bash
36+
export JAVA_HOME=$JAVA_HOME_DIR
37+
export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR
38+
export PATH=$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH
39+
cp ~/.gradle/gradle.properties $GRADLE_USER_HOME;
40+
cd ml-app-deployer
41+
./gradlew publish
42+
'''
43+
}
2844
}
2945
}
3046
}

build.gradle

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,19 @@ publishing {
143143
}
144144
repositories {
145145
maven {
146-
name = "central"
147-
url = mavenCentralUrl
148-
credentials {
149-
username mavenCentralUsername
150-
password mavenCentralPassword
146+
if (project.hasProperty("mavenUser")) {
147+
credentials {
148+
username mavenUser
149+
password mavenPassword
150+
}
151+
url publishUrl
152+
} else {
153+
name = "central"
154+
url = mavenCentralUrl
155+
credentials {
156+
username mavenCentralUsername
157+
password mavenCentralPassword
158+
}
151159
}
152160
}
153161
}

0 commit comments

Comments
 (0)