Skip to content
Snippets Groups Projects
Commit 8522ee3e authored by Clément Contet's avatar Clément Contet Committed by Pierre Smeyers
Browse files

feat: add support for npm scoped registries

parent 33d50b09
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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",
......
......@@ -35,7 +35,7 @@ variables:
NG_E2E_ARGS: >-
e2e
# Angular Build
NG_BUILD_ARGS: "build --prod"
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment