Skip to content

Commit 00a31cf

Browse files
committed
Bumped to 4.5-SNAPSHOT, added Jenkinsfile for publishing
1 parent 55ad0e1 commit 00a31cf

File tree

2 files changed

+74
-8
lines changed

2 files changed

+74
-8
lines changed

Jenkinsfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
@Library('shared-libraries') _
2+
pipeline{
3+
agent {label 'devExpLinuxPool'}
4+
options {
5+
checkoutToSubdirectory 'ml-gradle'
6+
buildDiscarder logRotator(artifactDaysToKeepStr: '7', artifactNumToKeepStr: '', daysToKeepStr: '30', numToKeepStr: '')
7+
}
8+
environment{
9+
JAVA_HOME_DIR="/home/builder/java/jdk-11.0.2"
10+
GRADLE_DIR =".gradle"
11+
DMC_USER = credentials('MLBUILD_USER')
12+
DMC_PASSWORD = credentials('MLBUILD_PASSWORD')
13+
}
14+
stages{
15+
stage('tests'){
16+
steps{
17+
copyRPM 'Release','10.0-9.4'
18+
setUpML '$WORKSPACE/xdmp/src/Mark*.rpm'
19+
sh label:'test', script: '''#!/bin/bash
20+
export JAVA_HOME=$JAVA_HOME_DIR
21+
export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR
22+
export PATH=$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH
23+
cd ml-gradle
24+
./gradlew test || true
25+
'''
26+
junit '**/build/**/*.xml'
27+
}
28+
}
29+
stage('publish'){
30+
when {
31+
branch 'dev'
32+
}
33+
steps{
34+
sh label:'publish', script: '''#!/bin/bash
35+
export JAVA_HOME=$JAVA_HOME_DIR
36+
export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR
37+
export PATH=$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH
38+
cp ~/.gradle/gradle.properties $GRADLE_USER_HOME;
39+
cd ml-gradle
40+
./gradlew publish
41+
'''
42+
}
43+
}
44+
}
45+
}

build.gradle

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,36 @@ plugins {
1212
}
1313

1414
group = "com.marklogic"
15-
version = "4.4.0"
15+
version = "4.5-SNAPSHOT"
1616

1717
java {
1818
sourceCompatibility = 1.8
1919
targetCompatibility = 1.8
2020
}
2121

2222
repositories {
23-
mavenLocal() // Used only for local development
2423
mavenCentral()
24+
maven {
25+
url "https://nexus.marklogic.com/repository/maven-snapshots/"
26+
}
27+
}
28+
29+
// Do not cache changing modules
30+
configurations.all {
31+
resolutionStrategy {
32+
cacheChangingModulesFor 0, 'seconds'
33+
}
2534
}
2635

2736
dependencies {
2837
implementation gradleApi()
2938
implementation localGroovy()
30-
api "com.marklogic:ml-app-deployer:4.4.0"
39+
api('com.marklogic:ml-app-deployer:4.5-SNAPSHOT') {
40+
changing = true
41+
}
3142
implementation "com.marklogic:mlcp-util:1.0.1"
43+
// TODO Will need to update this to 2.6.0 once it's released; the only planned change for this is to bump up the
44+
// Java Client to 6.1.0
3245
implementation "com.marklogic:marklogic-data-movement-components:2.5.0"
3346
implementation "commons-io:commons-io:2.11.0"
3447

@@ -114,11 +127,19 @@ publishing {
114127
}
115128
repositories {
116129
maven {
117-
name = "central"
118-
url = mavenCentralUrl
119-
credentials {
120-
username mavenCentralUsername
121-
password mavenCentralPassword
130+
if (project.hasProperty("mavenUser")) {
131+
credentials {
132+
username mavenUser
133+
password mavenPassword
134+
}
135+
url publishUrl
136+
} else {
137+
name = "central"
138+
url = mavenCentralUrl
139+
credentials {
140+
username mavenCentralUsername
141+
password mavenCentralPassword
142+
}
122143
}
123144
}
124145
}

0 commit comments

Comments
 (0)