forked from MithunTechnologiesDevOps/maven-web-application
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile7AMNovBatch2022
49 lines (36 loc) · 1.23 KB
/
Jenkinsfile7AMNovBatch2022
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
node{
properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '5', daysToKeepStr: '', numToKeepStr: '5')), [$class: 'JobLocalConfiguration', changeReasonComment: ''], pipelineTriggers([pollSCM('* * * * *')])])
echo "The Job name is: ${env.JOB_NAME}"
echo "The Nod ename is: ${env.NODE_NAME}"
echo "The Build Number is: ${env.BUILD_NUMBER}"
echo "The Jenkins Home directory is: ${JENKINS_HOME}"
def mavenHome = tool name: "maven3.8.6"
try{
sendSlackNotifications("STARTED")
stage('CheckoutCode'){
git branch: 'development', credentialsId: 'd3b6896a-ebbd-4396-8b5c-850f74d96a39', 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('UploadArtifactsIntoNexus'){
sh "${mavenHome}/bin/mvn deploy"
}
stage('DeployAppIntoTomcatServer'){
sshagent(['48c992f5-c73e-40ba-b71b-9191b6f93285']) {
sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war [email protected]:/usr/local/apache-tomcat-9.0.70/webapps/"
}
}
*/
}//try closing
catch(e){
currentBuild.result = "FAILURE"
}
finally{
sendSlackNotifications(currentBuild.result)
}
}