forked from apache/incubator-kie-kogito-runtimes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.drools
85 lines (83 loc) · 4.21 KB
/
Jenkinsfile.drools
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
@Library('jenkins-pipeline-shared-libraries')_
pipeline {
agent {
label 'kie-rhel7 && kie-mem16g'
}
tools {
maven 'kie-maven-3.6.2'
jdk 'kie-jdk11'
}
triggers {
cron ('H 10 * * *')
}
options {
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '5')
timeout(time: 120, unit: 'MINUTES')
}
environment {
KOGITO_CI_EMAIL_TO = credentials('KOGITO_CI_EMAIL_TO')
// query mvn to get the latest version
DROOLS_VERSION = """${sh (
script: '$(mvn versions:display-property-updates -DincludeProperties=version.org.kie7 -DallowSnapshots -N | grep version.org.kie7| cut -d" " -f8))'
returnStdout: true).trim()}"""
MAVEN_EXTRA_ARGS="-Dversion.org.kie7=${DROOLS_VERSION}"
MAVEN_OPTS = '-Xms1024m -Xmx4g'
}
stages {
stage('Build kogito-runtimes') {
steps {
script {
echo "Latest kie7 version is: ${DROOLS_VERSION}"
maven.runMavenWithSubmarineSettings("clean install ${MAVEN_EXTRA_ARGS}", false)
}
}
}
stage('Build kogito-apps') {
steps {
dir("kogito-apps") {
script {
checkout([$class: 'GitSCM', branches: [[name: env.BRANCH_NAME]], browser: [$class: 'GithubWeb', repoUrl: '[email protected]:kiegroup/kogito-apps.git'], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'kogito-apps']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'kie-ci-user-key', url: '[email protected]:kiegroup/kogito-apps.git']]])
maven.runMavenWithSubmarineSettings("clean install ${MAVEN_EXTRA_ARGS}", false)
}
}
}
}
stage('Build kogito-examples') {
steps {
checkout([$class: 'GitSCM', branches: [[name: env.BRANCH_NAME]], browser: [$class: 'GithubWeb', repoUrl: '[email protected]:kiegroup/kogito-examples.git'], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'kogito-examples']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'kie-ci-user-key', url: '[email protected]:kiegroup/kogito-examples.git']]])
dir("kogito-examples") {
script {
maven.runMavenWithSubmarineSettings("clean install ${MAVEN_EXTRA_ARGS}", false)
}
}
// Use a separate dir for persistence to not overwrite the test results
checkout([$class: 'GitSCM', branches: [[name: env.BRANCH_NAME]], browser: [$class: 'GithubWeb', repoUrl: '[email protected]:kiegroup/kogito-examples.git'], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'kogito-examples-persistence']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'kie-ci-user-key', url: '[email protected]:kiegroup/kogito-examples.git']]])
dir("kogito-examples-persistence") {
script {
// Don't run with tests so far, see: https://github.com/quarkusio/quarkus/issues/6885
maven.runMavenWithSubmarineSettings("clean install ${MAVEN_EXTRA_ARGS} -Ppersistence", true)
}
}
}
}
}
}
post {
failure {
emailext body: 'Kogito daily Drools #${BUILD_NUMBER} was: ' + "${currentBuild.currentResult}" + '\n' +
'Please look here: ${BUILD_URL} ',
subject: 'Kogito daily Drools #${BRANCH_NAME}',
to: env.KOGITO_CI_EMAIL_TO
}
unstable {
emailext body: 'Kogito daily Drools #${BUILD_NUMBER} was: ' + "${currentBuild.currentResult}" + '\n' +
'Please look here: ${BUILD_URL} ',
subject: 'Kogito daily Drools #${BRANCH_NAME}',
to: env.KOGITO_CI_EMAIL_TO
}
always {
junit '**/target/surefire-reports/**/*.xml'
cleanWs()
}
}
}