Hi All,
Today I just tried to integrate sonarqube + sonar scanner + jenkins + android kotlin + gradle sonarqube.
sonarqube V CE 7.4
sonar scanner V 3.2.0.1227
jenkins V 2.156
sonarqube gradle V 2.6.2
below is my pipeline
stage('SonarQube analysis') {
steps {
withSonarQubeEnv('SonarQube') {
// requires SonarQube Scanner for Gradle 2.1+
// It's important to add --info because of SONARJNKNS-281
sh './gradlew --info sonarqube'
}
}
}
stage("Quality Gate"){
post {
failure {
echo 'Pipeline aborted due to quality gate failure'
}
}
steps {
timeout(time: 1, unit: 'HOURS') {
script {
def qg = waitForQualityGate()
echo gg
if (qg.status != 'OK') {
error "Pipeline aborted due to quality gate failure: ${qg.status}"
}
}
}
}
}
When the “SonarQube analysis” step is finished, on my log, it will return task id = http://localhost:9000/api/ce/task?id=**AWgSZMUhePsewb-VCnub**. But on “Quality Gate” step always try to get with task id = http://localhost:9000/api/ce/task?id=**AWgOMDNbrTp5N9edQqAD**.
Please help me, Thanks