Created
February 22, 2020 15:06
-
-
Save pretty25/c0166b476b09c52d19e06991cfcb3f2f to your computer and use it in GitHub Desktop.
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
pipeline { | |
agent any | |
stages { | |
stage("Code Checkout") { | |
steps { | |
git branch: 'master', | |
//The repository containing the sonar-project.properties | |
url: 'https://github.com/pretty25/jenkins-git-integration.git' | |
} | |
} | |
stage('Code Quality') { | |
steps { | |
script { | |
sh "pwd" | |
//This will call the sonar-scanner installed in the Jenkins, then it will used the sonar-project.properties configuration on the directory(workspace) | |
//sh "/opt/sonar-scanner/bin/sonar-scanner -Dproject.settings=sonar-project.properties" | |
docker run -e SONAR_HOST_URL=http://192.168.1.112:9000/ --user="$(id -jenkins):$(id -jenkins)" -it -v "$PWD:/usr/src" sonarsource/sonar-scanner-cli | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment