URL-адрес SonarQube неверен в waitForQualityGate () - PullRequest
0 голосов
/ 23 октября 2018

waitForQualityGate () возвращает 401, потому что URL-адрес от моего первого сконфигурированного сервера SonarQube на Jenkins.И не из того, который я настроил для использования?

Если я вручную изменю URL-адрес другого сервера, я получу верный json.

Вот мой код: (Анализ успешен направильный сервер)

node {
                gitReference = checkout scm

                gitURL = gitReference.GIT_URL.replace('.git', '');
                gitURL += "/commit/${gitReference.GIT_COMMIT}"
                println("###> GIT Commit: ${gitURL}")

                measureDuration(script: this, measurementName: 'sonar_duration') {
                    println("###> Execute Sonar Scan START")
                    executeSonarScan(script: this, instance: 'sonarqube-my-second-server', options: "-Dsonar.projectVersion=${gitReference.GIT_COMMIT}", useWebhook: true)
                    println("###> Sonar Scan Finished FINISHED")
                }
            }

            // No need to occupy a node
            stage("Quality Gate"){
                timeout(time: 1, unit: 'HOURS') { // Just in case something goes wrong, pipeline will be killed after a timeout
                    waitForQualityGate()
                }
            }

У кого-нибудь есть идея, почему это происходит?

...