Commit 16ead865 authored by Cédric OLIVIER's avatar Cédric OLIVIER
Browse files

feat: Change boolean variable behaviour



BREAKING CHANGE: boolean variable now triggered on explicit 'true' value

Signed-off-by: default avatarCédric OLIVIER <cedric3.olivier@orange.com>
parent 3e07984a
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -83,10 +83,10 @@ 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/) | `sonar:sonar -Dsonar.host.url=${SONAR_URL} -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_QUALITY_GATE_ENABLED` | Enables blocking check of SonarQube [Quality Gate](https://docs.sonarqube.org/latest/user-guide/quality-gates/) | _none_ (disabled) |
| `SONAR_AUTO_ON_DEV_DISABLED` | When set to `true`, SonarQube analysis becomes **manual** on development branches (automatic otherwise) | _none_ |
| `SONAR_QUALITY_GATE_ENABLED` | Set to `true` to enables check of SonarQube [Quality Gate](https://docs.sonarqube.org/latest/user-guide/quality-gates/) | _none_ (disabled) |

#### Automatic Branch Analysis & Pull Request Analysis

@@ -152,7 +152,7 @@ It is bound to the `test` stage, and uses the following variables:

| Name                  | description                            | default value     |
| --------------------- | -------------------------------------- | ----------------- |
| `MVN_FORBID_SNAPSHOT_DEPENDENCIES_DISABLED` | Disable this job | _none_ |
| `MVN_FORBID_SNAPSHOT_DEPENDENCIES_DISABLED` | Set to `true` to disable this job | _none_ |

### `mvn-snapshot` &amp; `mvn-release` jobs

@@ -165,12 +165,12 @@ They are bound to the `publish` stage, and use the following variables:

| Name                                | description                                                  | default value     |
| ----------------------------------- | ------------------------------------------------------------ | ----------------- |
| `MAVEN_DEPLOY_ENABLED`              | Variable to enable a publish jobs                            | _none_ (disabled) |
| `MAVEN_DEPLOY_FROM_UNPROTECTED_DISABLED`       | Variable to limit snapshot publication to protected branches | _none_ (disabled) |
| `MAVEN_DEPLOY_ENABLED`              | Set to `true` to enable a publish jobs                            | _none_ (disabled) |
| `MAVEN_DEPLOY_FROM_UNPROTECTED_DISABLED`       | Set to `true` to limit snapshot publication to protected branches | _none_ (disabled) |
| `MAVEN_DEPLOY_ARGS`                 | Maven arguments for the Snapshot job                         | `deploy -DskipTests` |
| `MAVEN_RELEASE_ARGS`                | Maven arguments for the Release job                          | `release:prepare release:perform -DskipTests` |
| `MAVEN_RELEASE_SCM_COMMENT_PREFIX`  | Maven release plugin [scmCommentPrefix](https://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#scmCommentPrefix) parameter  | `[ci skip][maven-release-plugin]` |
| `MVN_SEMREL_RELEASE_DISABLED`  | Disable [semantic-release integration](#semantic-release-integration)   | `[ci skip][maven-release-plugin]` |
| `MVN_SEMREL_RELEASE_DISABLED`  | Set to `true` to disable [semantic-release integration](#semantic-release-integration)   | `[ci skip][maven-release-plugin]` |

More info:

+10 −10
Original line number Diff line number Diff line
@@ -130,7 +130,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
@@ -426,7 +426,7 @@ stages:
    esac
  }

  if [[ -z "$TEMPLATE_CHECK_UPDATE_DISABLED" ]]; then check_for_update maven "1.4.2"; fi
  if [[ "$TEMPLATE_CHECK_UPDATE_DISABLED" != "true" ]]; then check_for_update maven "1.4.2"; fi
  unscope_variables

  # ENDSCRIPT
@@ -481,7 +481,7 @@ mvn-sonar:
    - sonar_autodetect_mr
    - if [[ "$SONAR_GITLAB_TOKEN" ]]; then sonar_extra_args="$SONAR_GITLAB_ARGS"; fi
    - mvn ${TRACE+-Dsonar.verbose=true} $MAVEN_CLI_OPTS $java_proxy_args ${SONAR_AUTH_TOKEN+-Dsonar.login=$SONAR_AUTH_TOKEN} ${SONAR_LOGIN+-Dsonar.login=$SONAR_LOGIN} ${SONAR_PASSWORD+-Dsonar.password=$SONAR_PASSWORD} $SONAR_BASE_ARGS $sonar_extra_args $sonar_mr_args
    - if [[ "$SONAR_QUALITY_GATE_ENABLED" ]]; then sonar_quality_gate_check; fi
    - if [[ "$SONAR_QUALITY_GATE_ENABLED" == "true" ]]; then sonar_quality_gate_check; fi
  rules:
    # exclude merge requests
    - if: $CI_MERGE_REQUEST_ID
@@ -494,7 +494,7 @@ mvn-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
@@ -535,7 +535,7 @@ mvn-forbid-snapshot-dependencies:
    - if: $CI_MERGE_REQUEST_ID
      when: never
    # exclude if disabled
    - if: $MVN_FORBID_SNAPSHOT_DEPENDENCIES_DISABLED
    - if: '$MVN_FORBID_SNAPSHOT_DEPENDENCIES_DISABLED == "true"'
      when: never
    # on production or integration branches: auto
    - if: '$CI_COMMIT_REF_NAME =~ $PROD_REF || $CI_COMMIT_REF_NAME =~ $INTEG_REF'
@@ -555,10 +555,10 @@ mvn-snapshot:
    - if: $CI_COMMIT_TAG
      when: never
    # exclude unprotected ref if specified
    - if: '$MAVEN_DEPLOY_FROM_UNPROTECTED_DISABLED && $CI_COMMIT_REF_PROTECTED != "true"'
    - if: '$MAVEN_DEPLOY_FROM_UNPROTECTED_DISABLED == "true" && $CI_COMMIT_REF_PROTECTED != "true"'
      when: never
    # else: if $MAVEN_DEPLOY_ENABLED is set
    - if: $MAVEN_DEPLOY_ENABLED
    - if: '$MAVEN_DEPLOY_ENABLED == "true"'

mvn-release:
  extends: .mvn-base
@@ -575,7 +575,7 @@ mvn-release:
    - configure_scm_auth
    - maybe_set_version_from_git
    - |
      if [ "${SEMREL_INFO_ON}" ] && [ -z "${MVN_SEMREL_RELEASE_DISABLED}" ]
      if [ "${SEMREL_INFO_ON}" ] && [ "${MVN_SEMREL_RELEASE_DISABLED}" != "true" ]
      then
        if [ -z "${SEMREL_INFO_NEXT_VERSION}" ]
        then
@@ -592,10 +592,10 @@ mvn-release:
    - if: $CI_MERGE_REQUEST_ID
      when: never
    # on production branch(es): manual & non-blocking if $MAVEN_DEPLOY_ENABLED is set
    - if: '$MAVEN_DEPLOY_ENABLED && $CI_COMMIT_REF_NAME =~ $PROD_REF'
    - if: '$MAVEN_DEPLOY_ENABLED == "true" && $CI_COMMIT_REF_NAME =~ $PROD_REF'
      when: manual
      allow_failure: true
    # on integration branch(es): manual & non-blocking if $MAVEN_DEPLOY_ENABLED is set
    - if: '$MAVEN_DEPLOY_ENABLED && $CI_COMMIT_REF_NAME =~ $INTEG_REF'
    - if: '$MAVEN_DEPLOY_ENABLED == "true" && $CI_COMMIT_REF_NAME =~ $INTEG_REF'
      when: manual
      allow_failure: true