Skip to content

Commit

Permalink
Create JenkinsfileMSSDevOps
Browse files Browse the repository at this point in the history
  • Loading branch information
devopstrainingblr committed Feb 2, 2020
1 parent 296a2ca commit f68098d
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions JenkinsfileMSSDevOps
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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 ec2-user@13.232.147.123:/opt/apache-tomcat-9.0.30/webapps/"
}
}

stage('SendEmailNotification')
{
emailext body: '''Build is over

Regards,
MT,
9980923226''', subject: 'Build is over', to: 'devopstrainingblr@gmail.com'
}

}

0 comments on commit f68098d

Please sign in to comment.