forked from jenkins-docs/simple-java-maven-app
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathJenkinsfile
More file actions
44 lines (42 loc) · 1018 Bytes
/
Jenkinsfile
File metadata and controls
44 lines (42 loc) · 1018 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
30
31
32
33
34
35
36
37
38
39
40
41
42
pipeline {
agent any
stages {
stage('Checkout') {
steps {
git branch: 'branch3', url: 'https://github.com/Vanny253/simple-java-maven-app.git'
}
}
stage('Build') {
steps {
bat 'mvn clean package -DskipTests'
}
}
stage('Test') {
steps {
bat 'mvn test'
}
post {
always {
junit 'target/surefire-reports/*.xml' // This will show test results in Jenkins
}
}
}
stage('Deliver') {
steps {
bat 'jenkins\\scripts\\deliver.bat'
}
}
}
post {
always {
echo 'Cleaning up workspace'
deleteDir() // Clean up the workspace after the build
}
success {
echo 'Build succeeded!!!'
}
failure {
echo 'Build failed!'
}
}
}