-
Notifications
You must be signed in to change notification settings - Fork 0
/
continuous.groovy
50 lines (43 loc) · 1.39 KB
/
continuous.groovy
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
pipeline {
agent any
options {
skipStagesAfterUnstable()
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '28'))
timeout(time: 1, unit: 'HOURS')
timestamps()
}
stages {
stage("Build and Test") {
steps {
notifyBitBucket state: "INPROGRESS"
mavenbuild jdkVersion: [groupId: "jenkins.tools.java", artifactId : "openJDK", version: "12_linux-x64", packaging: "tar.gz"],
mavenArgs: "-DcreateChecksum=true -Dmaven.javadoc.skip=true", uploadArtifactsWithBranchnameInVersion: true
script {
pomInfo = readMavenPom file: 'pom.xml'
currentBuild.description = pomInfo.version
}
}
}
stage("Sonar Code Quality Analysis") {
steps {
sonar()
}
}
}
post {
success {
notifyBitBucket state: "SUCCESSFUL"
}
fixed {
mailTo status: "SUCCESS", actuator: true, recipients: [], logExtract: true
}
failure {
notifyBitBucket state: "FAILED"
mailTo status: "FAILURE", actuator: true, recipients: [], logExtract: true
}
always {
junit allowEmptyResults: true, testResults: '**/target/*-reports/TEST*.xml'
}
}
}