-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
41 lines (35 loc) · 909 Bytes
/
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
pipeline {
agent any
tools {
maven 'Maven 3'
jdk 'Java 8'
}
options {
buildDiscarder(logRotator(artifactNumToKeepStr: '2'))
}
environment {
COMMIT = sh(returnStdout: true, script: "git log -n 1 --pretty=format:'%h'").trim()
VERSION = readMavenPom().getVersion()
}
stages {
stage ('Build') {
steps {
script {
currentBuild.displayName = "${VERSION} #${BUILD_NUMBER}".replace("-SNAPSHOT", "")
currentBuild.description = "git-${COMMIT}"
}
sh 'mvn clean package'
}
post {
success {
archiveArtifacts artifacts: 'target/facade-*.jar', fingerprint: true
}
}
}
}
post {
always {
deleteDir()
}
}
}