forked from apache/incubator-kie-kogito-runtimes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.deploy
144 lines (142 loc) · 5.92 KB
/
Jenkinsfile.deploy
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
@Library('jenkins-pipeline-shared-libraries')_
pipeline {
agent {
label 'kie-rhel7 && kie-mem16g'
}
environment {
KOGITO_CI_EMAIL_TO = credentials('KOGITO_CI_EMAIL_TO')
MAVEN_OPTS = '-Xms1024m -Xmx4g'
}
tools {
maven 'kie-maven-3.6.2'
jdk 'kie-jdk11'
}
triggers {
cron ('H 9 * * *')
}
options {
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '5')
timeout(time: 120, unit: 'MINUTES')
}
stages {
stage('Build kogito-runtimes') {
steps {
script {
maven.runMavenWithSubmarineSettings('clean install', false)
}
}
post {
always {
saveReports()
}
}
}
stage('Build kogito-apps') {
steps {
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']]])
dir("kogito-apps") {
script {
maven.runMavenWithSubmarineSettings('clean install', false)
}
}
}
post {
always {
saveReports()
}
}
}
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', false)
}
}
}
post {
always {
saveReports()
}
}
}
stage('Build kogito-examples with persistence') {
steps {
// 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 {
maven.runMavenWithSubmarineSettings('clean install -Ppersistence', false)
}
}
}
post {
always {
saveReports()
}
}
}
stage('Build kogito-examples with events') {
steps {
// Use a separate dir for events 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-events']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'kie-ci-user-key', url: '[email protected]:kiegroup/kogito-examples.git']]])
dir("kogito-examples-events") {
script {
maven.runMavenWithSubmarineSettings('clean install -Pevents', false)
}
}
}
post {
always {
saveReports()
}
}
}
stage('Deploy kogito-runtimes') {
steps {
script {
maven.runMavenWithSubmarineSettings('clean deploy', true)
}
}
}
stage('Deploy kogito-apps') {
steps {
dir("kogito-apps") {
script {
maven.runMavenWithSubmarineSettings('clean deploy', true)
}
}
}
}
stage('Deploy kogito-examples') {
steps {
dir("kogito-examples") {
script {
maven.runMavenWithSubmarineSettings('clean deploy', true)
}
}
}
}
}
post {
failure {
emailext body: 'Kogito daily snapshot deploy #${BUILD_NUMBER} was: ' + "${currentBuild.currentResult}" + '\n' +
'Please look here: ${BUILD_URL} ',
subject: 'Kogito daily snapshot deploy #${BRANCH_NAME}',
to: env.KOGITO_CI_EMAIL_TO
}
unstable {
emailext body: 'Kogito daily snapshot deploy #${BUILD_NUMBER} was: ' + "${currentBuild.currentResult}" + '\n' +
'Please look here: ${BUILD_URL} ',
subject: 'Kogito daily snapshot deploy #${BRANCH_NAME}',
to: env.KOGITO_CI_EMAIL_TO
}
always {
cleanWs()
}
}
}
void saveReports(boolean allowEmpty=false){
junit testResults: '**/target/surefire-reports/**/*.xml, **/target/failsafe-reports/**/*.xml', allowEmptyResults: allowEmpty
}