Commit 6d4ba9dd authored by Cédric OLIVIER's avatar Cédric OLIVIER Committed by Pierre SMEYERS
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 54d74bfa
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ It is bound to the `test` stage, and uses the following variable:

| Name             | description                                                                 | default value |
| ---------------- | --------------------------------------------------------------------------- | ------------- |
| `NODE_LINT_ENABLED` | Variable to enable lint analysis                                         | _none_ (disabled)|
| `NODE_LINT_ENABLED` | Set to `true` to enable lint analysis                                         | _none_ (disabled)|
| `NODE_LINT_ARGS` | NPM [run-script](https://docs.npmjs.com/cli/run-script.html) arguments to execute the lint analysis | `run lint`        |
| `NODE_LINT_REPORT_PATH` | Variable to define lint analysis report path                                        | `reports/eslint-report.json`|

@@ -51,7 +51,7 @@ This job is bound to the `build` stage, and uses the following variables:

| Name              | description                                                  | default value        |
| ----------------- | ------------------------------------------------------------ | -------------------- |
| `NODE_BUILD_DISABLED` | Variable to disable build                                | _none_ (enabled)     |
| `NODE_BUILD_DISABLED` | Set to `true` to disable build                                | _none_ (enabled)     |
| `NODE_BUILD_DIR`  | Variable to define build directory                           | `dist`               |
| `NODE_BUILD_ARGS` | NPM [build](https://docs.npmjs.com/cli/build.html) arguments | `run build --prod`       |
| `NODE_TEST_ARGS`  | NPM [test](https://docs.npmjs.com/cli/test.html) arguments   | `test -- --coverage --bail` |
@@ -248,7 +248,7 @@ npm install --save-dev npm-audit-html

| Name                  | description        | default value     |
| --------------------- | -----------------  | ----------------- |
| `NODE_AUDIT_DISABLED` | Variable to disable npm audit                           | _none_ (enabled)     |
| `NODE_AUDIT_DISABLED` | Set to `true` to disable npm audit                           | _none_ (enabled)     |
| `NODE_AUDIT_ARGS`     | NPM [audit](https://docs.npmjs.com/cli/audit) arguments | `--audit-level=low` |
| `NODE_AUDIT_JSON_PATH`| NPM [audit](https://docs.npmjs.com/cli/audit) JSON report path | `reports/npm-audit-report.json` |
| `NODE_AUDIT_HTML_ARGS`| NPM [audit HTML](https://www.npmjs.com/package/npm-audit-html) report generation arguments | `--output reports/npm-audit-report.html` |
@@ -263,6 +263,6 @@ To activate the NodeJsScan, you need to set some VARIABLES

| Name                  | description        | default value     |
| --------------------- | -----------------  | ----------------- |
| `NODEJSSCAN_ENABLED`  | Variable to enable njsscan analysis | _none_ (disabled) |
| `NODEJSSCAN_ENABLED`  | Set to `true` to enable njsscan analysis | _none_ (disabled) |
| `NODEJSSCAN_IMAGE`    | njsscan image   | `opensecurity/njsscan:latest` |
| `NODEJSSCAN_ARGS`     | njsscan [arguments](https://github.com/ajinabraham/njsscan#command-line-options) | `-o reports/nodejsscan-report.txt` |
+7 −7
Original line number Diff line number Diff line
@@ -237,7 +237,7 @@ stages:
    fi
  }

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

  # ENDSCRIPT
@@ -267,7 +267,7 @@ node-build:
  script:
    # launch unit test and code coverage
    - npm $NODE_TEST_ARGS
    - if [[ -z "$NODE_BUILD_DISABLED" ]]; then npm $NODE_BUILD_ARGS; fi
    - if [[ "$NODE_BUILD_DISABLED" != "true" ]]; then npm $NODE_BUILD_ARGS; fi
  coverage: '/^All files\s*\|\s*(\d+(?:\.\d+)?)/'
  artifacts:
    reports:
@@ -301,7 +301,7 @@ node-lint:
    - if: $CI_MERGE_REQUEST_ID
      when: never
    # exclude if $NODE_LINT_ENABLED not set
    - if: '$NODE_LINT_ENABLED == null || $NODE_LINT_ENABLED == "false"'
    - if: '$NODE_LINT_ENABLED != "true"'
      when: never
    # on production or integration branches: auto
    - if: '$CI_COMMIT_REF_NAME =~ $PROD_REF || $CI_COMMIT_REF_NAME =~ $INTEG_REF'
@@ -332,11 +332,11 @@ node-js-scan:
    - if: $CI_MERGE_REQUEST_ID
      when: never
    # on production branch(es): if $NODEJSSCAN_ENABLED is set
    - if: '$NODEJSSCAN_ENABLED && $CI_COMMIT_REF_NAME =~ $PROD_REF'
    - if: '$NODEJSSCAN_ENABLED == "true" && $CI_COMMIT_REF_NAME =~ $PROD_REF'
    # on integration branch(es): if $NODEJSSCAN_ENABLED is set
    - if: '$NODEJSSCAN_ENABLED && $CI_COMMIT_REF_NAME =~ $INTEG_REF'
    - if: '$NODEJSSCAN_ENABLED == "true" && $CI_COMMIT_REF_NAME =~ $INTEG_REF'
    # on non-production, non-integration branches, with $NODEJSSCAN_ENABLED set: manual & non-blocking
    - if: '$NODEJSSCAN_ENABLED'
    - if: '$NODEJSSCAN_ENABLED == "true"'
      when: manual
      allow_failure: true

@@ -358,7 +358,7 @@ node-npm-audit:
    - if: $CI_MERGE_REQUEST_ID
      when: never
    # exclude if $NODE_AUDIT_DISABLED set
    - if: $NODE_AUDIT_DISABLED
    - if: $NODE_AUDIT_DISABLED == "true"
      when: never
    # on production or intergation branch(es)
    - if: '$CI_COMMIT_REF_NAME =~ $PROD_REF || $CI_COMMIT_REF_NAME =~ $INTEG_REF'