forked from apache/incubator-kie-kogito-runtimes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.deploy.new
151 lines (148 loc) · 6.46 KB
/
Jenkinsfile.deploy.new
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
145
146
147
148
149
150
151
@Library('jenkins-pipeline-shared-libraries')_
pipeline {
agent {
label 'kie-rhel7 && kie-mem16g'
}
parameters {
string(name: 'DISPLAY_NAME', defaultValue: '', description: 'Setup a specific build display name')
string(name: 'BUILD_BRANCH_NAME', defaultValue: 'master', description: 'Which branch to build ? Set if you are not on a multibranch pipeline.')
}
environment {
MAVEN_OPTS = '-Xms1024m -Xmx4g'
}
tools {
maven 'kie-maven-3.6.2'
jdk 'kie-jdk11'
}
options {
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '5')
timeout(time: 120, unit: 'MINUTES')
}
stages {
stage("Initialize") {
steps {
script {
if (params.DISPLAY_NAME != "") {
currentBuild.displayName = params.DISPLAY_NAME
}
if (env.BRANCH_NAME != "") {
// Switch to branch if not on a multibranch pipeline
env.BRANCH_NAME = params.BUILD_BRANCH_NAME
}
}
}
}
stage('Build kogito-runtimes') {
steps {
checkout([$class: 'GitSCM', branches: [[name: env.BRANCH_NAME]], browser: [$class: 'GithubWeb', repoUrl: '[email protected]:kiegroup/kogito-runtimes.git'], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'kogito-runtimes']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'kie-ci-user-key', url: '[email protected]:kiegroup/kogito-runtimes.git']]])
dir("kogito-runtimes") {
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 {
dir("kogito-runtimes") {
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 {
always {
cleanWs()
}
}
}
void saveReports(boolean allowEmpty=false){
junit testResults: '**/target/surefire-reports/**/*.xml, **/target/failsafe-reports/**/*.xml', allowEmptyResults: allowEmpty
}