forked from MaheshBangaru/maven-web-application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile-backup
62 lines (50 loc) · 1.33 KB
/
Jenkinsfile-backup
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
#!groovy
properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '3'))])
//Test - SIngle Line comment
node {
/*
stage('Checkout') {
git branch: 'master', credentialsId: '21311c83-a7a7-4316-8a19-b5b828aaf1a9', url: ' https://github.com/MithunTechnologiesDevOps/maven-web-application.git'
}
*/
stage('Checkout'){
checkout scm
}
stage('Testing')
{
if(isUnix()){
sh 'mvn test'
}
else{
bat 'mvn test'
}
}
stage('SonarQube Report Generation')
{
if(isUnix()){
sh 'mvn sonar:sonar'
}
else{
bat 'mvn sonar:sonar'
}
}
stage('NexusDeploy')
{
if(isUnix()){
sh 'mvn deploy'
}
else{
bat 'mvn deploy'
}
}
stage ('Deploy to Tomcat'){
sh 'echo deploying application into tomcat'
sh 'cp $WORKSPACE/target/*.war /Users/bhaskarreddyl/BhaskarReddyL/Softwares/Running/apache-tomcat-9.0.12/webapps/'
sh 'echo deploymnet done'
}
stage ('Email Notifcation'){
mail bcc: '', body: '''Build done
Regards,
Mithun Technologies''', cc: '[email protected]', from: '', replyTo: '', subject: 'Deployment done', to: '[email protected],[email protected]'
}
}