forked from MithunTechnologiesDevOps/maven-web-application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
JenkinsfileMarch2023
39 lines (28 loc) · 1.08 KB
/
JenkinsfileMarch2023
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
node{
properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '5', daysToKeepStr: '', numToKeepStr: '5')), [$class: 'JobLocalConfiguration', changeReasonComment: ''], pipelineTriggers([pollSCM('* * * * *')])])
def mavenHome = tool name: 'maven3.9.1'
echo "The Job name is: ${JOB_NAME} "
echo "The Node name is: ${NODE_NAME}"
echo "The Build Number is: ${BUILD_NUMBER}"
echo "Jenkins Home path is: ${JENKINS_HOME}"
stage('CheckoutCode'){
git branch: 'development', credentialsId: 'aaa8e2c0-226a-40ba-85eb-259762d67c15', url: 'https://github.com/MithunTechnologiesDevOps/maven-web-application.git'
}
stage('Build')
{
sh "${mavenHome}/bin/mvn clean package"
}
/*
stage('SonarQubeReport'){
sh "${mavenHome}/bin/mvn clean sonar:sonar"
}
stage('UploadArtifactsIntoNexus'){
sh "${mavenHome}/bin/mvn clean deploy"
}
stage('DeployAppIntoTomcat'){
sshagent(['dd085870-ab36-4a86-9f5b-a915e179d45d']) {
sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war [email protected]:/opt/apache-tomcat-9.0.73/webapps/"
}
}
*/
}//node closing