-
Notifications
You must be signed in to change notification settings - Fork 6
/
Jenkinsfile
47 lines (43 loc) · 1.67 KB
/
Jenkinsfile
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
pipeline {
agent any
options {
timeout(time: 30, unit: 'MINUTES')
}
stages {
stage('checkout') {
steps {
checkout([$class: 'GitSCM', branches: [[name: "*/${env.BRANCH_NAME}"]],
extensions: [[$class: 'CleanCheckout'],
[$class: 'LocalBranch', localBranch: "${env.BRANCH_NAME}"]]])
}
}
stage('build') {
steps {
withMaven(
maven: 'default', // Tools declared in the Jenkins "Global Tool Configuration"
jdk: 'default'){
sh 'mvn -U clean deploy'
} // withMaven will discover the generated Maven artifacts, JUnit reports and FindBugs reports
}
}
}
post {
success {
sh '$JENKINS_HOME/scripts/updateGithubIssue.sh'
}
failure {
emailext attachLog: true,
to: "[email protected]",
subject: "Build failed in Jenkins: ${currentBuild.fullDisplayName}",
body: """<p>FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
<p>Check console output at "<a href='${env.BUILD_URL}'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>"</p>"""
}
unstable {
emailext attachLog: true,
to: "[email protected]",
subject: "Jenkins build became unstable: ${currentBuild.fullDisplayName}",
body: """<p>UNSTABLE: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
<p>Check console output at "<a href='${env.BUILD_URL}'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>"</p>"""
}
}
}