Skip to content
Snippets Groups Projects
Commit c3579a10 authored by Pierre SMEYERS's avatar Pierre SMEYERS
Browse files

Merge branch '1-change_variable_behaviour' into 'master'

feat: Change boolean variable behaviour

Closes #1

See merge request to-be-continuous/sonar!3
parents 3e6cd88f b8f2b40a
No related branches found
No related tags found
No related merge requests found
......@@ -31,9 +31,9 @@ It is bound to the `test` stage, and uses the following variables:
| :lock: `SONAR_PASSWORD` | SonarQube password (depends on your authentication method) | _none_ |
| `SONAR_BASE_ARGS` | SonarQube [analysis arguments](https://docs.sonarqube.org/latest/analysis/analysis-parameters/) | `-Dsonar.host.url=${SONAR_URL} -Dsonar.projectKey=${CI_PROJECT_PATH_SLUG} -Dsonar.projectName=${CI_PROJECT_PATH} -Dsonar.projectBaseDir=. -Dsonar.links.homepage=${CI_PROJECT_URL} -Dsonar.links.ci=${CI_PROJECT_URL}/-/pipelines -Dsonar.links.issue=${CI_PROJECT_URL}/-/issues` |
| :lock: `SONAR_GITLAB_TOKEN` | GitLab [access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) with `api` scope. When set, activates the [Sonar GitLab plugin](https://github.com/gabrie-allaigre/sonar-gitlab-plugin/#plugins-properties) integration. | _none_ |
| `SONAR_BRANCH_ANALYSIS_DISABLED` | Set to disable automatic [Pull Request Analysis](https://docs.sonarqube.org/latest/analysis/pull-request/) and [Branch Analysis](https://docs.sonarqube.org/latest/branches/overview/) | _none_ (enabled) |
| `SONAR_BRANCH_ANALYSIS_DISABLED` | Set to `true` to disable automatic [Pull Request Analysis](https://docs.sonarqube.org/latest/analysis/pull-request/) and [Branch Analysis](https://docs.sonarqube.org/latest/branches/overview/) | _none_ (enabled) |
| `SONAR_GITLAB_ARGS` | Extra arguments to use with [Sonar GitLab plugin](https://github.com/gabrie-allaigre/sonar-gitlab-plugin/#plugins-properties) | `-Dsonar.gitlab.url=${CI_SERVER_URL} -Dsonar.gitlab.user_token=${SONAR_GITLAB_TOKEN} -Dsonar.gitlab.project_id=${CI_PROJECT_ID} -Dsonar.gitlab.commit_sha=${CI_COMMIT_SHA} -Dsonar.gitlab.ref_name=${CI_COMMIT_REF_NAME}` |
| `SONAR_AUTO_ON_DEV_DISABLED` | When set, SonarQube analysis becomes **manual** on development branches (automatic otherwise) | _none_ |
| `SONAR_AUTO_ON_DEV_DISABLED` | When set to `true`, SonarQube analysis becomes **manual** on development branches (automatic otherwise) | _none_ |
#### Automatic Branch Analysis & Pull Request Analysis
......
......@@ -119,7 +119,7 @@ stages:
}
function sonar_autodetect_mr() {
if [[ "$SONAR_BRANCH_ANALYSIS_DISABLED" ]]
if [[ "$SONAR_BRANCH_ANALYSIS_DISABLED" == "true" ]]
then
log_info "Branch Analysis and Merge Request Analysis are disabled"
return
......@@ -278,7 +278,7 @@ stages:
fi
}
if [[ -z "$TEMPLATE_CHECK_UPDATE_DISABLED" ]]; then check_for_update sonar "1.3.2"; fi
if [[ "$TEMPLATE_CHECK_UPDATE_DISABLED" != "true" ]]; then check_for_update sonar "1.3.2"; fi
unscope_variables
# ENDSCRIPT
......@@ -316,7 +316,7 @@ sonar:
# on production or integration: auto
- if: '$CI_COMMIT_REF_NAME =~ $PROD_REF || $CI_COMMIT_REF_NAME =~ $INTEG_REF'
# else (non-production, non-integration branches): manual if $SONAR_AUTO_ON_DEV_DISABLED
- if: $SONAR_AUTO_ON_DEV_DISABLED
- if: '$SONAR_AUTO_ON_DEV_DISABLED == "true"'
when: manual
allow_failure: true
# else: auto & allow failure
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment