-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
63 lines (60 loc) · 1.41 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
pipeline{
agent any
tools {
maven "maven3.8.6"
}
stages {
stage('1GetCode'){
steps{
sh "echo 'cloning the latest application version' "
git "https://github.com/suhaad79/maven-web-application"
}
}
stage('3Test+Build'){
steps{
sh "echo 'running JUnit-test-cases' "
sh "echo 'testing must passed to create artifacts ' "
sh "mvn clean package"
}
}
/*
stage('4CodeQuality'){
steps{
sh "echo 'Perfoming CodeQualityAnalysis' "
sh "mvn sonar:sonar"
}
}
stage('5uploadNexus'){
steps{
sh "mvn deploy"
}
}
stage('8deploy2prod'){
steps{
deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://54.85.126.59:8080')], contextPath: null, war: 'target/*war'
}
}
}
post{
always{
emailext body: '''Hello,
Please check build status
thanks
suhaad''', recipientProviders: [developers()], subject: 'success', to: 'sjay4a@gmail.com'
}
success{
emailext body: '''Hello,
Build and deployment succesful. Good job
thanks
suhaad''', recipientProviders: [developers()], subject: 'success', to: 'sjay4a@gmail.com'
}
failure{
emailext body: '''Hello,
Build failed. Please check status
thanks
suhaad''', recipientProviders: [developers()], subject: 'success', to: 'sjay4a@gmail.com'
}
}
*/
}
}