Commit 1ac9dddf authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

refactor(publish): auto manage verbose option with $TRACE

parent 304ee1b4
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -311,11 +311,11 @@ It uses the following variables:

| Name                       | description                                                                 | default value                                                    |
|----------------------------|-----------------------------------------------------------------------------|------------------------------------------------------------------|
| `NG_PUBLISH_ENABLED`       | Set variable to `true` to enable the publish job                            | none (disabled)                                                  |
| `NG_PUBLISH_PROJECTS`      | Space separated list of projects to publish                                 | If no project is specified, all workspace projects are published |
| `NG_PUBLISH_ARGS`          | NPM [publish](https://docs.npmjs.com/cli/v6/commands/npm-publish) arguments | `--verbose`                                                      |
| `NPM_PUBLISH_REGISTRY`     | npm registry to publish to | uses GitLab project npm packages registry      |                                                                  |
| :lock: `NPM_PUBLISH_TOKEN` | NPM publication registry authentication token                               | none                                                             |
| `NG_PUBLISH_ENABLED`       | Set variable to `true` to enable the publish job                            | _none_ (disabled) |
| `NG_PUBLISH_PROJECTS`      | Space separated list of projects to publish                                 | _none_ (all workspace projects are published) |
| `NG_PUBLISH_ARGS`          | NPM [publish](https://docs.npmjs.com/cli/v6/commands/npm-publish) arguments | _none_ |
| `NPM_PUBLISH_REGISTRY`     | npm registry to publish to | uses GitLab project npm packages registry      | _none_ |
| :lock: `NPM_PUBLISH_TOKEN` | NPM publication registry authentication token                               | _none_ |

:warning: When using the gitlab registry (which is the default behavior), your NPM package name must be in the format of `@scope/package-name`:

+0 −1
Original line number Diff line number Diff line
@@ -68,7 +68,6 @@
        {
          "name": "NG_PUBLISH_ARGS",
          "description": "npm [publish](https://docs.npmjs.com/cli/v6/commands/npm-publish) arguments",
          "default": "--verbose",
          "advanced": true
        },
        {
+1 −2
Original line number Diff line number Diff line
@@ -88,7 +88,6 @@ variables:

  # Set some args of `npm publish` command
  # ex: NG_PUBLISH_ARGS: "--dry-run"
  NG_PUBLISH_ARGS: '--verbose'

# ==================================================
# Stages definition
@@ -413,7 +412,7 @@ stages:
      fi

      log_info "Publishing project '${project}' from ${projectOutputDir}"
      npm publish "${projectOutputDir}" "${NG_PUBLISH_ARGS}"
      npm publish ${TRACE+--verbose} "${projectOutputDir}" "${NG_PUBLISH_ARGS}"
    done
  }