Commit 6b515033 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

Merge branch 'scoped-registries' into 'master'

Add support for npm scoped registries

See merge request to-be-continuous/angular!10
parents 33d50b09 8522ee3e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ The Angular template uses some global configuration used throughout all jobs.
|----------------|-----------------------------------------------|:--------------------------------------------------------------------------|
| `NG_CLI_IMAGE`        | The Docker image used to run Angular-CLI (ng) <br/>:warning: **set the version required by your project** | `trion/ng-cli-karma:latest` |
| `NPM_CONFIG_REGISTRY` | NPM [registry](https://docs.npmjs.com/configuring-your-registry-settings-as-an-npm-enterprise-user)                | _none_ (defaults to `https://registry.npmjs.org`) |
| `NPM_CONFIG_SCOPED_REGISTRIES` | Space separated list of NPM [scoped registries](https://docs.npmjs.com/cli/v8/using-npm/scope#associating-a-scope-with-a-registry) (formatted as `@somescope:https://some.npm.registry/some/repo @anotherscope:https://another.npm.registry/another/repo`) | _none_ |
| `NG_WORKSPACE_DIR`    | Angular workspace directory       | `.` |

## Jobs
+5 −0
Original line number Diff line number Diff line
@@ -15,6 +15,11 @@
      "type": "url",
      "advanced": true
    },
    {
      "name": "NPM_CONFIG_SCOPED_REGISTRIES",
      "description": "Space separated list of NPM [scoped registries](https://docs.npmjs.com/cli/v8/using-npm/scope#associating-a-scope-with-a-registry) (formatted as `@somescope:https://some.npm.registry/some/repo @anotherscope:https://another.npm.registry/another/repo`)",
      "advanced": true
    },
    {
      "name": "NG_WORKSPACE_DIR",
      "description": "Angular workspace directory",
+9 −1
Original line number Diff line number Diff line
@@ -412,6 +412,14 @@ stages:
    - install_ca_certs "${CUSTOM_CA_CERTS:-$DEFAULT_CA_CERTS}"
    # NPM_CONFIG_REGISTRY is not supported by old npm versions: force with cli
    - if [[ "$NPM_CONFIG_REGISTRY" ]]; then npm config set registry $NPM_CONFIG_REGISTRY; fi
    - |
      if [[ "$NPM_CONFIG_SCOPED_REGISTRIES" ]];
      then
        for scoped_registry in $NPM_CONFIG_SCOPED_REGISTRIES
        do
          npm config set "${scoped_registry%%:*}":registry "${scoped_registry#*:}";
        done
      fi
    - configure_gitlab_instance_level_npm_registry_auth
    - npm ci --cache .npm --prefer-offline