From e391e6de5fe7d6f9671aa7513b12274ea80b7957 Mon Sep 17 00:00:00 2001 From: Bill Wallace Date: Fri, 12 Jun 2026 20:05:44 -0400 Subject: [PATCH] fix: Fix the deployment to viewer-dev caused by missing .npmrc (#6076) @ fix(ci): restore committed .npmrc in Docker build jobs (pnpm migration) The pnpm migration (#6031) made the Dockerfile COPY .npmrc into the builder stage because pnpm needs the workspace config it carries (node-linker=hoisted, link-workspace-packages). But the Docker jobs still ran `rm -f ./.npmrc` immediately before `docker build` -- a leftover from when .npmrc only held npm credentials. NPM_PUBLISH overwrites the tracked .npmrc with a publish auth token and persists it to the workspace, so the Docker jobs deleted the file the Dockerfile requires: ERROR [builder 6/13] COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./ failed to compute cache key: "/.npmrc": not found DEPLOY_MASTER therefore failed at DOCKER_BETA_PUBLISH on every master build after the migration (NPM_PUBLISH still pushed the version bump first, so npm packages shipped but the latest-beta image never did -- leaving viewer-dev.ohif.org stuck on the prior beta). Replace `rm -f ./.npmrc` with `git checkout -- .npmrc` in the four Docker *build* jobs so the committed, token-free workspace-config .npmrc is restored before the build. The two manifest jobs keep `rm` since they do not build from the Dockerfile. @ Co-authored-by: Claude Opus 4.8 (1M context) --- .circleci/config.yml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5a5065cfa..61f22019c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -251,8 +251,11 @@ jobs: if [[ ! -e version.txt ]]; then exit 0 else - # Remove npm config - rm -f ./.npmrc + # Restore the committed .npmrc (pnpm workspace config such as + # node-linker=hoisted). NPM_PUBLISH overwrote it with a publish + # auth token, but the Dockerfile COPYs .npmrc for the in-image + # pnpm install, so it needs the config file present and token-free. + git checkout -- .npmrc # Set our version number using vars export IMAGE_VERSION=$(cat version.txt) export IMAGE_VERSION_FULL=v$IMAGE_VERSION @@ -285,8 +288,11 @@ jobs: if [[ ! -e version.txt ]]; then exit 0 else - # Remove npm config - rm -f ./.npmrc + # Restore the committed .npmrc (pnpm workspace config such as + # node-linker=hoisted). NPM_PUBLISH overwrote it with a publish + # auth token, but the Dockerfile COPYs .npmrc for the in-image + # pnpm install, so it needs the config file present and token-free. + git checkout -- .npmrc # Set our version number using vars export IMAGE_VERSION=$(cat version.txt) export IMAGE_VERSION_FULL=v$IMAGE_VERSION @@ -323,7 +329,11 @@ jobs: exit 0 else echo "Building and pushing Docker image from the master branch (beta releases)" - rm -f ./.npmrc + # Restore the committed .npmrc (pnpm workspace config such as + # node-linker=hoisted). NPM_PUBLISH overwrote it with a publish + # auth token, but the Dockerfile COPYs .npmrc for the in-image + # pnpm install, so it needs the config file present and token-free. + git checkout -- .npmrc # Set our version number using vars export IMAGE_VERSION=$(cat version.txt) @@ -357,7 +367,11 @@ jobs: exit 0 else echo "Building and pushing ARM64 Docker image from the master branch (beta releases)" - rm -f ./.npmrc + # Restore the committed .npmrc (pnpm workspace config such as + # node-linker=hoisted). NPM_PUBLISH overwrote it with a publish + # auth token, but the Dockerfile COPYs .npmrc for the in-image + # pnpm install, so it needs the config file present and token-free. + git checkout -- .npmrc # Set our version number using vars export IMAGE_VERSION=$(cat version.txt) export IMAGE_VERSION_FULL=v$IMAGE_VERSION