-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
executable file
·42 lines (41 loc) · 1.24 KB
/
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
42
pipeline {
agent any
// tools {
// maven 'M3'
// }
stages {
stage('Pre') {
steps {
sh 'bash ./pre.sh'
}
}
stage('Build') {
steps {
// sh 'export A=$(lsof -t -i:8082)'
sh 'mvn clean package'
sh 'docker build -t backend .'
sh 'docker container run -d -p 8081:8080 --name my-backend backend'
sh 'docker rmi $(docker images -f "dangling=true" -q)'
}
}
// stage('Deliver') {
// steps {
// // sh 'cd ./target'
// // sh 'pwd'
// // sh 'java -jar ./target/api-0.0.1-SNAPSHOT.jar'
// }
// }
}
post {
failure {
subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
body: "Something is wrong with ${env.BUILD_URL}"
}
success {
subject: "Success notification from Jenkins!",
body: "Success!"
}
}
}