Skip to content

Instantly share code, notes, and snippets.

@karthikeayan
Created March 26, 2020 09:56
Show Gist options
  • Save karthikeayan/98bb047088da288841cf23838dd78426 to your computer and use it in GitHub Desktop.
Save karthikeayan/98bb047088da288841cf23838dd78426 to your computer and use it in GitHub Desktop.
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