forked from MithunTechnologiesDevOps/maven-web-application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
JenkinsfileMSSDevOps
48 lines (36 loc) · 1.07 KB
/
JenkinsfileMSSDevOps
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
node
{
properties([[$class: 'JiraProjectProperty'], buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '5', daysToKeepStr: '', numToKeepStr: '5')), pipelineTriggers([pollSCM('* * * * *')])])
def mavenHome = tool name: "maven3.6.3"
stage('CheckoutCode')
{
git branch: 'development', credentialsId: '03b8d2fd-388b-4944-bb34-1419ee66975d', url: 'https://github.com/MithunTechnologiesDevOps/maven-web-application.git'
}
stage('MavenBuild')
{
sh "${mavenHome}/bin/mvn clean package"
}
/*
stage('ExecuteSonarQubeReport')
{
sh "${mavenHome}/bin/mvn sonar:sonar"
}
stage('UploadArtifcatIntoNexus')
{
sh "${mavenHome}/bin/mvn deploy"
}
stage('DeployAppIntoTomcatServer')
{
sshagent(['314d01b5-1319-43a4-852d-43b364c46ac5']) {
sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war [email protected]:/opt/apache-tomcat-9.0.30/webapps/"
}
}
stage('SendEmailNotification')
{
emailext body: '''Build is over
Regards,
MT,
9980923226''', subject: 'Build is over', to: '[email protected]'
}
*/
}