mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 07:34:35 +02:00
enh(chore): remove CI's timeout workaround (#2945)
This commit is contained in:
parent
b60d21d47e
commit
b0ce582d19
25
centreon-plugins/Jenkinsfile
vendored
25
centreon-plugins/Jenkinsfile
vendored
@ -1,5 +1,3 @@
|
|||||||
import groovy.json.JsonSlurper
|
|
||||||
|
|
||||||
properties([buildDiscarder(logRotator(numToKeepStr: '50'))])
|
properties([buildDiscarder(logRotator(numToKeepStr: '50'))])
|
||||||
|
|
||||||
stage('Source') {
|
stage('Source') {
|
||||||
@ -20,34 +18,13 @@ stage('Source') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// sonarQube step to get qualityGate result
|
||||||
stage('Quality gate') {
|
stage('Quality gate') {
|
||||||
node {
|
node {
|
||||||
def reportFilePath = "target/sonar/report-task.txt"
|
|
||||||
def reportTaskFileExists = fileExists "${reportFilePath}"
|
|
||||||
if (reportTaskFileExists) {
|
|
||||||
echo "Found report task file"
|
|
||||||
def taskProps = readProperties file: "${reportFilePath}"
|
|
||||||
echo "taskId[${taskProps['ceTaskId']}]"
|
|
||||||
timeout(time: 10, unit: 'MINUTES') {
|
|
||||||
while (true) {
|
|
||||||
sleep 10
|
|
||||||
def taskStatusResult =
|
|
||||||
sh(returnStdout: true, script: "curl -s -X GET -u ${authString} \'${sonarProps['sonar.host.url']}/api/ce/task?id=${taskProps['ceTaskId']}\'")
|
|
||||||
echo "taskStatusResult[${taskStatusResult}]"
|
|
||||||
def taskStatus = new JsonSlurper().parseText(taskStatusResult).task.status
|
|
||||||
echo "taskStatus[${taskStatus}]"
|
|
||||||
// Status can be SUCCESS, ERROR, PENDING, or IN_PROGRESS. The last two indicate it's
|
|
||||||
// not done yet.
|
|
||||||
if (taskStatus != "IN_PROGRESS" && taskStatus != "PENDING") {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
def qualityGate = waitForQualityGate()
|
def qualityGate = waitForQualityGate()
|
||||||
if (qualityGate.status != 'OK') {
|
if (qualityGate.status != 'OK') {
|
||||||
currentBuild.result = 'FAIL'
|
currentBuild.result = 'FAIL'
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
|
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
|
||||||
error("Quality gate failure: ${qualityGate.status}.");
|
error("Quality gate failure: ${qualityGate.status}.");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user