From 1406ea9c133cc0c2be24ec68f429eac970a63cad Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Sat, 18 Jan 2025 02:44:51 +0100 Subject: [PATCH] ci(azure-pipelines): add build-arg for custom npm registry --- azure-pipelines.yaml | 1 + docker/frontend/Dockerfile | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/azure-pipelines.yaml b/azure-pipelines.yaml index 1fe547299..943c9bd86 100644 --- a/azure-pipelines.yaml +++ b/azure-pipelines.yaml @@ -30,6 +30,7 @@ jobs: --build-arg HTTP_PROXY=http://proxy.frankfurt-airport.de:8080 \ --build-arg NO_PROXY='localhost,127.0.0.1,*.docker.internal,*.azmk8s.io,devfra.azurecr.io,devfra.westeurope.data.azurecr.io' \ --build-arg FRAPORT_NOPROXY=dev.azure.com,*.dev.azure.com,*.fraport.de,*.frankfurt-airport.de \ + --build-arg NPM_CUSTOM_REGISTRY=https://pkgs.dev.azure.com/fraport/_packaging/packages/npm/registry/ \ --build-arg MOUNT_DIR=$(Build.Repository.LocalPath) \ --build-arg PROJECT_DIR=/fradrive \ --tag devfra.azurecr.io/de.fraport.fradrive.build/frontend:$(Build.BuildNumber) \ diff --git a/docker/frontend/Dockerfile b/docker/frontend/Dockerfile index c3cfeaf67..c1107561d 100644 --- a/docker/frontend/Dockerfile +++ b/docker/frontend/Dockerfile @@ -27,6 +27,10 @@ RUN --mount=type=bind,source=.,target=${MOUNT_DIR},rw if [ "${PROJECT_DIR}" != " WORKDIR ${PROJECT_DIR} ENV HOME=${PROJECT_DIR} +RUN if [ ! -z "${NPM_CUSTOM_REGISTRY}" ]; then \ +printf 'registry=https://pkgs.dev.azure.com/fraport/_packaging/packages/npm/registry/\n\nalways-auth=true' > .npmrc \ +; fi + RUN make -- --dependencies-frontend IN_CONTAINER=true ENV FRADRIVE_MAKE_TARGET=compile-frontend