forked from MaheshBangaru/maven-web-application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile-old
48 lines (35 loc) · 1.17 KB
/
Jenkinsfile-old
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
#!groovy
properties([
buildDiscarder(logRotator(numToKeepStr: '3')),
pipelineTriggers([
pollSCM('* * * * *')
])
])
node('node1'){
def mavenHome = tool name: 'Maven3.1.1', type: 'maven'
stage('Checkoutthecode'){
git branch: 'master', credentialsId: '07dd149d-4881-45a8-86ed-3cf7a77cccce', url: 'https://github.com/MithunTechnologiesDevOps/maven-web-application.git'
}
stage('Build'){
sh "${mavenHome}/bin/mvn clean package"
}
stage('SoanrQubeReport'){
sh "${mavenHome}/bin/mvn sonar:sonar"
}
stage('UploadArtifactsToNexus'){
sh "${mavenHome}/bin/mvn clean deploy"
}
/*
stage('DeployIntoTomcat'){
sh "echo app is deploying"
sh "cp $WORKSPACE/target/*.war /opt/apache-tomcat-9.0.16/webapps/"
sh "echo App is deployed"
}
*/
stage('SendEmailNotification'){
mail bcc: '[email protected]', body: '''Build Done
Regards,
Mithun Technologies
''', cc: '[email protected]', from: '', replyTo: '', subject: 'Build done', to: '[email protected],[email protected]'
}
}