forked from apache/incubator-kie-kogito-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile-sonarcloud-daily
51 lines (50 loc) · 1.55 KB
/
Jenkinsfile-sonarcloud-daily
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('jenkins-pipeline-shared-libraries')_
pipeline {
agent {
label 'kie-rhel7 && kie-mem16g'
}
triggers {
cron('H 20 * * 1-5')
}
tools {
maven 'kie-maven-3.6.2'
jdk 'kie-jdk11'
}
options {
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')
timeout(time: 120, unit: 'MINUTES')
}
environment {
KOGITO_CI_EMAIL_TO = credentials('KOGITO_CI_EMAIL_TO')
SONARCLOUD_TOKEN = credentials('SONARCLOUD_TOKEN')
MAVEN_OPTS = '-Xms1024m -Xmx4g'
}
stages {
stage('Build kogito-apps') {
steps {
script {
maven.runMavenWithSubmarineSettings('clean install -Prun-code-coverage', false)
}
}
}
stage('Analyze kogito-apps') {
steps {
script {
maven.runMavenWithSubmarineSettings('-e -nsu validate -Psonarcloud-analysis', false)
}
}
}
}
post {
unsuccessful {
emailext body: 'Kogito Apps daily Sonar #${BUILD_NUMBER} was: ' + "${currentBuild.currentResult}" + '\n' +
'Please look here: ${BUILD_URL} ',
subject: "[${env.BRANCH_NAME}][d] Runtimes Sonar",
to: env.KOGITO_CI_EMAIL_TO
}
always {
junit '**/target/surefire-reports/**/*.xml, **/target/failsafe-reports/**/*.xml'
cleanWs()
}
}
}