Created
October 28, 2019 15:12
-
-
Save leolanese/509c13f03c6aab6e76b5caf37ee9ff66 to your computer and use it in GitHub Desktop.
sonar-jenkins
This file contains hidden or 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
node{ | |
stage('SCM Checkout'){ | |
git 'https://github.com/javahometech/my-app' | |
} | |
stage('Compile-Package'){ | |
// Get maven home path | |
def mvnHome = tool name: 'maven-3', type: 'maven' | |
sh "${mvnHome}/bin/mvn package" | |
} | |
stage('SonarQube Analysis') { | |
def mvnHome = tool name: 'maven-3', type: 'maven' | |
withSonarQubeEnv('sonar-6') { | |
sh "${mvnHome}/bin/mvn sonar:sonar" | |
} | |
} | |
stage('Email Notification'){ | |
mail bcc: '', body: '''Hi Welcome to jenkins email alerts | |
Thanks | |
Hari''', cc: '', from: '', replyTo: '', subject: 'Jenkins Job', to: '[email protected]' | |
} | |
stage('Slack Notification'){ | |
slackSend baseUrl: 'https://hooks.slack.com/services/', | |
channel: '#jenkins-pipeline-demo', | |
color: 'good', | |
message: 'Welcome to Jenkins, Slack!', | |
teamDomain: 'javahomecloud', | |
tokenCredentialId: 'slack-demo' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment