Skip to content

Commit

Permalink
Create mithuntechnologiespipeLine
Browse files Browse the repository at this point in the history
  • Loading branch information
devopstrainingblr authored Feb 14, 2019
1 parent 5591d35 commit ac07462
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions mithuntechnologiespipeLine
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!groovy

properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '2'))])


node {

cleanWs notFailBuild: true


stage('Checkout the Code'){
git branch: 'development', credentialsId: 'dc9bee7b-a6ef-4ffd-a07b-7c97617a378a', url: 'https://github.com/MithunTechnologiesDevOps/maven-web-application.git'
}

stage('Build'){

if(isUnix()){
sh 'mvn clean package'
}else{
bat 'mvn clean package'
}
}
stage('SonarQubeReport'){

if(isUnix()){
sh 'mvn sonar:sonar'
}else{
bat 'mvn sonar:sonar'
}
}

stage('Upload Artifacts into Nexus'){

if(isUnix()){
sh 'mvn deploy'
}else{
bat 'mvn deploy'
}
}



stage('Deploy the App into Tomcat Server')
{

sh 'echo Deploy the app into tomcat server'
sh 'cp $WORKSPACE/target/maven-web-application.war /Users/bhaskarreddyl/BhaskarReddyL/Softwares/Running/apache-tomcat-9.0.14/mithunapps/'
sh 'echo app deployed successfully'
}
stage('Send Email Notification'){

mail bcc: '[email protected]', body: '''Build is done!!
Regards,
Mithun Technologies
Martaha Halli
Bangalore
9980923226
''', cc: '[email protected]', from: '', replyTo: '', subject: 'Build Done', to: '[email protected]'
}


stage ('Send Slack Notification')
{
slackSend baseUrl: 'https://devops-team-bangalore.slack.com/services/hooks/jenkins-ci/', channel: 'build-notification', message: '"Build Done"', tokenCredentialId: '193d10e7-9280-4629-84e8-5ec4a30b87b5' }


}



0 comments on commit ac07462

Please sign in to comment.