forked from MithunTechnologiesDevOps/maven-web-application
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f5c17c
commit 34b6e9f
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
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" | ||
|
||
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/" | ||
} | ||
} | ||
|
||
|
||
} |