-
Notifications
You must be signed in to change notification settings - Fork 11
/
Jenkinsfile
46 lines (40 loc) · 1.12 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
43
44
45
46
pipeline {
agent any
tools {
maven "Maven_Home"
}
stages {
stage('Stage 1 - Checkout Code') {
steps {
//Get the code form GITHUB
git 'https://github.com/ajautomation/PassParametersRunTimeViaMVN'
}
}
stage('Stage 2 - Compile Code') {
steps {
//cmd to compile the code
bat "mvn compile"
//sh "mvn compile"
}
}
stage('Stage 3 - Run Unit Tests') {
steps {
//cmd to run tests
bat "mvn test"
}
}
stage('Stage 4 -Create build') {
steps {
//cmd to create the build of project
bat "mvn testpackage"
}
}
}
post{
failure {
//Send email to team about the failure
//emailext body: 'Jenkins build failed', subject: 'Jenkins build failed', to: '[email protected]'
echo "Email sent for Jenkins build failed"
}
}
}