-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
44 lines (42 loc) · 1.18 KB
/
Copy pathJenkinsfile
File metadata and controls
44 lines (42 loc) · 1.18 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
pipeline {
agent any
tools {
maven 'mvn3'
}
stages {
stage('Checkout Code'){
steps {
git branch: 'main',
url: "https://github.com/MP-30/spring_boot_devops.git"
}
}
stage('Build'){
steps{
dir(''){
sh 'mvn clean package'
}
}
}
stage('Deploy'){
steps{
dir(''){
sh 'nohup java -jar target/*.jar > app.log 2>&1 &'
}
}
}
}
post {
success {
archiveArtifacts artifacts: 'target/*.jar', followSymlinks: false
// Replaced 'emailext' with 'mail' to use your existing configuration
mail body: 'This is for my personal testing.. Hi Hi ha ha hu hu',
subject: 'Testing my Jenkins',
to: 'learningonly092@gmail.com'
}
failure {
mail body: 'Jenkins Pipeline Failed! Please check the terminal logs.',
subject: 'ALARM: Jenkins Build Failed',
to: 'learningonly092@gmail.com'
}
}
}