forked from jenkins-docs/simple-java-maven-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
29 lines (25 loc) · 803 Bytes
/
Jenkinsfile
File metadata and controls
29 lines (25 loc) · 803 Bytes
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
node {
docker.image('maven:3.9.6-eclipse-temurin-17-alpine').inside('-v /root/.m2:/root/.m2') {
try {
stage('Build') {
sh 'mvn -B -DskipTests clean package'
}
stage('Test') {
sh 'mvn test'
junit 'target/surefire-reports/*.xml'
}
stage('Manual Approval') {
input message: 'Lanjutkan ke tahap Deploy? (Klik "Proceed" untuk mengakhiri)'
}
stage('Deploy') {
sh './jenkins/scripts/deliver.sh'
sleep 60
}
} catch (Exception e) {
currentBuild.result = 'FAILURE'
throw e
} finally {
// You can add any cleanup steps here
}
}
}