Skip to content

Commit

Permalink
Integrating with sonar qube
Browse files Browse the repository at this point in the history
  • Loading branch information
javahomehari committed May 30, 2019
1 parent c4c18b9 commit a769a8f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

node {

def sonarUrl = 'sonar.host.url=http://172.31.30.136:9000'
def mvn = tool (name: 'maven3', type: 'maven') + '/bin/mvn'
stage('SCM Checkout'){
// Clone repo
git branch: 'master',
Expand All @@ -10,14 +11,17 @@ node {
}

stage('Sonar Publish'){
// lets do
withCredentials([string(credentialsId: 'sonarqube', variable: 'sonarToken')]) {
def sonarToken = "sonar.login=${sonarToken}"
sh "${mvn} sonar:sonar -D${sonarUrl} -D${sonarToken}"
}

}



stage('Mvn Package'){
// Build using maven
def mvn = tool (name: 'maven3', type: 'maven') + '/bin/mvn'

sh "${mvn} clean package deploy"
}

Expand Down

0 comments on commit a769a8f

Please sign in to comment.