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

Commit 86b517e

Browse files
DEVO-718: Publishing artifacts to nexus
1 parent b0cee57 commit 86b517e

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
@@ -134,11 +134,19 @@ publishing {
134134
}
135135
repositories {
136136
maven {
137-
name = "central"
138-
url = mavenCentralUrl
139-
credentials {
140-
username mavenCentralUsername
141-
password mavenCentralPassword
137+
if (project.hasProperty("mavenUser")) {
138+
credentials {
139+
username mavenUser
140+
password mavenPassword
141+
}
142+
url publishUrl
143+
} else {
144+
name = "central"
145+
url = mavenCentralUrl
146+
credentials {
147+
username mavenCentralUsername
148+
password mavenCentralPassword
149+
}
142150
}
143151
}
144152
}

0 commit comments

Comments
 (0)