forked from spring-projects/spring-petclinic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
54 lines (50 loc) · 1.48 KB
/
Jenkinsfile
File metadata and controls
54 lines (50 loc) · 1.48 KB
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
52
53
#!/usr/bin/env groovy
pipeline {
agent none
environment {
COMPLIANCEENABLED = true
}
options {
skipDefaultCheckout()
buildDiscarder(logRotator(artifactDaysToKeepStr: '1', artifactNumToKeepStr: '1', daysToKeepStr: '5', numToKeepStr: '10'))
}
stages {
stage('Build') {
agent {
docker {
image 'maven:3.5'
label 'dind'
args '-v /root/.m2:/root/.m2'
}
}
steps {
sh 'rm -rf *'
checkout scm
script {
env.gitCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()
echo "Commit ID: ${gitCommit}"
}
sh 'MAVEN_OPTS="-Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss.SSS" mvn -B -s settings.xml -DskipTests clean package'
}
post {
always {
deleteDir()
}
success {
echo "Build stage completed"
}
failure {
echo "Build stage failed"
}
}
}
}
post {
success {
echo 'Your predix-cicd-java pipeline has completed.'
}
failure {
echo "There was an error in the predix-cdcd-java pipeline build"
}
}
}