From 39a54bc62a90c9fdf5e7b53e9c9cfaba656d5d8a Mon Sep 17 00:00:00 2001 From: David Boreham Date: Mon, 17 Apr 2023 13:40:49 -0600 Subject: [PATCH] Use CERC_NPM_REGISTRY_URL everywhere (#340) --- app/build_containers.py | 2 +- .../container-build/cerc-laconic-console-host/Dockerfile | 8 ++++---- .../container-build/cerc-laconic-console-host/build.sh | 2 +- .../container-build/cerc-laconic-registry-cli/Dockerfile | 8 ++++---- .../container-build/cerc-laconic-registry-cli/build.sh | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/build_containers.py b/app/build_containers.py index 3a47a6da..ea16c3c9 100644 --- a/app/build_containers.py +++ b/app/build_containers.py @@ -84,7 +84,7 @@ def command(ctx, include, exclude, force_rebuild, extra_build_args): # TODO: make this configurable container_build_env = { - "CERC_NPM_URL": "http://gitea.local:3000/api/packages/cerc-io/npm/", + "CERC_NPM_REGISTRY_URL": config("CERC_NPM_REGISTRY_URL", default="http://gitea.local:3000/api/packages/cerc-io/npm/"), "CERC_NPM_AUTH_TOKEN": config("CERC_NPM_AUTH_TOKEN", default=""), "CERC_REPO_BASE_DIR": dev_root_path, "CERC_CONTAINER_BASE_DIR": container_build_dir, diff --git a/app/data/container-build/cerc-laconic-console-host/Dockerfile b/app/data/container-build/cerc-laconic-console-host/Dockerfile index 51a86560..a31aa265 100644 --- a/app/data/container-build/cerc-laconic-console-host/Dockerfile +++ b/app/data/container-build/cerc-laconic-console-host/Dockerfile @@ -7,7 +7,7 @@ ARG USERNAME=node ARG NPM_GLOBAL=/usr/local/share/npm-global # This container pulls npm packages from a local registry configured via these env vars -ARG CERC_NPM_URL +ARG CERC_NPM_REGISTRY_URL ARG CERC_NPM_AUTH_TOKEN # Add NPM global to PATH. @@ -49,9 +49,9 @@ COPY ./start-serving-app.sh /scripts # RUN su node -c "npm install -g " # Configure the local npm registry -RUN npm config set @cerc-io:registry ${CERC_NPM_URL} \ - && npm config set @lirewine:registry ${CERC_NPM_URL} \ - && npm config set -- ${CERC_NPM_URL}:_authToken ${CERC_NPM_AUTH_TOKEN} +RUN npm config set @cerc-io:registry ${CERC_NPM_REGISTRY_URL} \ + && npm config set @lirewine:registry ${CERC_NPM_REGISTRY_URL} \ + && npm config set -- ${CERC_NPM_REGISTRY_URL}:_authToken ${CERC_NPM_AUTH_TOKEN} RUN mkdir -p /config COPY ./config.yml /config diff --git a/app/data/container-build/cerc-laconic-console-host/build.sh b/app/data/container-build/cerc-laconic-console-host/build.sh index a321b195..77a38917 100755 --- a/app/data/container-build/cerc-laconic-console-host/build.sh +++ b/app/data/container-build/cerc-laconic-console-host/build.sh @@ -8,4 +8,4 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) docker build -t cerc/laconic-console-host:local ${build_command_args} -f ${SCRIPT_DIR}/Dockerfile \ --add-host gitea.local:host-gateway \ - --build-arg CERC_NPM_AUTH_TOKEN --build-arg CERC_NPM_URL ${SCRIPT_DIR} + --build-arg CERC_NPM_AUTH_TOKEN --build-arg CERC_NPM_REGISTRY_URL ${SCRIPT_DIR} diff --git a/app/data/container-build/cerc-laconic-registry-cli/Dockerfile b/app/data/container-build/cerc-laconic-registry-cli/Dockerfile index da7ff19a..7859adb4 100644 --- a/app/data/container-build/cerc-laconic-registry-cli/Dockerfile +++ b/app/data/container-build/cerc-laconic-registry-cli/Dockerfile @@ -7,7 +7,7 @@ ARG USERNAME=node ARG NPM_GLOBAL=/usr/local/share/npm-global # This container pulls npm packages from a local registry configured via these env vars -ARG CERC_NPM_URL +ARG CERC_NPM_REGISTRY_URL ARG CERC_NPM_AUTH_TOKEN # Add NPM global to PATH. @@ -42,9 +42,9 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ # RUN su node -c "npm install -g " # Configure the local npm registry -RUN npm config set @cerc-io:registry ${CERC_NPM_URL} \ - && npm config set @lirewine:registry ${CERC_NPM_URL} \ - && npm config set -- ${CERC_NPM_URL}:_authToken ${CERC_NPM_AUTH_TOKEN} +RUN npm config set @cerc-io:registry ${CERC_NPM_REGISTRY_URL} \ + && npm config set @lirewine:registry ${CERC_NPM_REGISTRY_URL} \ + && npm config set -- ${CERC_NPM_REGISTRY_URL}:_authToken ${CERC_NPM_AUTH_TOKEN} # TODO: the image at this point could be made a base image for several different CLI images # that install different Node-based CLI commands diff --git a/app/data/container-build/cerc-laconic-registry-cli/build.sh b/app/data/container-build/cerc-laconic-registry-cli/build.sh index a6264f4b..c9379856 100755 --- a/app/data/container-build/cerc-laconic-registry-cli/build.sh +++ b/app/data/container-build/cerc-laconic-registry-cli/build.sh @@ -8,4 +8,4 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) docker build -t cerc/laconic-registry-cli:local ${build_command_args} -f ${SCRIPT_DIR}/Dockerfile \ --add-host gitea.local:host-gateway \ - --build-arg CERC_NPM_AUTH_TOKEN --build-arg CERC_NPM_URL ${SCRIPT_DIR} + --build-arg CERC_NPM_AUTH_TOKEN --build-arg CERC_NPM_REGISTRY_URL ${SCRIPT_DIR}