Created
March 26, 2020 09:56
-
-
Save karthikeayan/98bb047088da288841cf23838dd78426 to your computer and use it in GitHub Desktop.
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
pipeline { | |
agent any | |
stages { | |
stage('Checkout') { | |
steps { | |
checkout scm | |
} | |
} | |
stage('Print all env') { | |
steps { | |
echo sh(returnStdout: true, script: 'env') | |
} | |
} | |
stage('Replace branch name in properties file') { | |
steps { | |
sh "sed -i 's~replaceBranchHere~${GIT_BRANCH}~g' sonar-project.properties" | |
} | |
} | |
stage('SonarQube') { | |
environment { | |
scannerHome = tool 'SonarQubeScanner' | |
} | |
steps { | |
withSonarQubeEnv('sonarqube') { | |
sh "${scannerHome}/bin/sonar-scanner -X" | |
} | |
//timeout(time: 10, unit: 'MINUTES') { | |
// waitForQualityGate abortPipeline: true | |
//} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment