Closed amimas closed 6 years ago
Resolved it by modifying my build.gradle
script like this so that those properties do not get applied if we're not running preview analysis. Otherwise, my original post will apply those properties to master branch also, which doesn't run "preview analysis"
sonarqube {
properties {
if(System.getenv('sonar.analysis.mode') == "preview") {
property 'sonar.gitlab.max_blocker_issues_gate', 1
property 'sonar.gitlab.max_critical_issues_gate', 1
property 'sonar.gitlab.project_id', System.getenv("CI_PROJECT_PATH")
property 'sonar.gitlab.commit_sha', System.getenv("CI_COMMIT_SHA")
property 'sonar.gitlab.ref_name', System.getenv("CI_COMMIT_REF_NAME")
}
}
}
Hello,
I have the plugin setup and working. My
gitlab-ci.yml
file looks like this:This works fine. I wanted to clean up the script a little bit. So, I moved the
sonar.gitlab.xxx
properties fromgitlab-ci.yml
file to my gradle script, whose snippet is below:new
gitlab-ci.yml
script:build.gradle
script:However now, with the pipeline of the master branch is keep failing. It's reporting something like this in the failure:
With my new change, why is the master branch suddenly being reported as a failure? I understand the overall project quality did not pass, but my pipeline in Gitlab CI shouldn't be failing for the master branch.