forked from MaheshBangaru/maven-web-application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
JenkinsfilePaytm
45 lines (31 loc) · 942 Bytes
/
JenkinsfilePaytm
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
node('paytmnode'){
properties([
buildDiscarder(logRotator(numToKeepStr: '3')),
pipelineTriggers([
pollSCM('* * * * *')
])
])
def mavenHome = tool name: 'maven3.6.1', type: 'maven'
stage('CheckoutCode') {
git branch: 'master', credentialsId: '82478555-478a-4b62-900c-fcdedfa161a3', url: 'https://github.com/MithunTechnologiesDevOps/maven-web-application.git'
}
stage('Build') {
sh "${mavenHome}/bin/mvn clean package"
}
stage('ExecuteSonarQubeReport') {
sh "${mavenHome}/bin/mvn sonar:sonar"
}
stage('UploadArtifactIntoNexus') {
sh "${mavenHome}/bin/mvn deploy"
}
stage('DeployAppIntoTomcat'){
sh "cp $WORKSPACE/target/*.war /opt/apache-tomcat-9.0.19/webapps/"
}
stage('SendEmailNotification'){
emailext body: '''Build is Over
Regards,
Mithun Technologies,
9980923226.
''', subject: 'Build is Over', to: '[email protected]'
}
}