checkout workspace
[maven-build-process.git] / build / jenkins / Jenkinsfile
blobf976b282e34db206fa9f9af18f5cd3bfc88c570e
1 node {
2     stage "Checkout"
3     checkout scm
5     stage "Tooling"
6     def mvnHome = tool "maven-3.3.9"
7     
8     stage "Timestamp"
9     sh 'date "+%Y.%m.%d-%H%M%S" > TIMESTAMP'
10     def timestamp = readFile("TIMESTAMP")
12     try {
13         wrap([$class: "ConfigFileBuildWrapper", managedFiles: [[fileId: "5b2469a4-b601-41f5-9ee8-4158696fb575", targetLocation: "settings.xml", variable: ""]]]) {
14             stage "Versioning"
15             sh "${mvnHome}/bin/mvn  -s settings.xml versions:set -DgenerateBackupPoms=false -DnewVersion=${timestamp}"
16         
17             stage "Build & Deploy"
18             sh "${mvnHome}/bin/mvn -s settings.xml clean deploy -DskipLocalStaging=true"
19         }
20     } finally {
21         stage "Cleanup"
22         sh "rm -f settings.xml"
23         sh "rm -f TIMESTAMP"
24     }