-
Notifications
You must be signed in to change notification settings - Fork 78
/
Jenkinsfile
51 lines (51 loc) · 1.55 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
@Library('shared-libraries') _
pipeline{
agent {label 'devExpLinuxPool'}
options {
checkoutToSubdirectory 'ml-gradle'
buildDiscarder logRotator(artifactDaysToKeepStr: '7', artifactNumToKeepStr: '', daysToKeepStr: '30', numToKeepStr: '')
}
environment{
JAVA_HOME_DIR="/home/builder/java/jdk-11.0.2"
GRADLE_DIR =".gradle"
DMC_USER = credentials('MLBUILD_USER')
DMC_PASSWORD = credentials('MLBUILD_PASSWORD')
}
stages{
stage('tests'){
steps{
copyRPM 'Release','11.3.0'
setUpML '$WORKSPACE/xdmp/src/Mark*.rpm'
sh label:'test', script: '''#!/bin/bash
export JAVA_HOME=$JAVA_HOME_DIR
export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR
export PATH=$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH
cd ml-gradle
cd ml-javaclient-util-test-app
echo "mlPassword=admin" > gradle-local.properties
../gradlew -i mlDeploy
cd ..
./gradlew ml-javaclient-util:test || true
./gradlew ml-app-deployer:test || true
./gradlew ml-gradle:test || true
'''
junit '**/build/**/*.xml'
}
}
stage('publish'){
when {
branch 'dev'
}
steps{
sh label:'publish', script: '''#!/bin/bash
export JAVA_HOME=$JAVA_HOME_DIR
export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR
export PATH=$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH
cp ~/.gradle/gradle.properties $GRADLE_USER_HOME;
cd ml-gradle
./gradlew publish
'''
}
}
}
}