From a6180a187d68aa2eb85f23aef56c2ef71ced5905 Mon Sep 17 00:00:00 2001 From: copilotcoder Date: Wed, 22 Jul 2026 22:37:31 -0400 Subject: [PATCH] fix: install npm in cicd base image --- .gitea/workflows/cicd.yaml | 10 +++++----- Dockerfile.cicd-base | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/cicd.yaml b/.gitea/workflows/cicd.yaml index d14fac2..6ce807b 100644 --- a/.gitea/workflows/cicd.yaml +++ b/.gitea/workflows/cicd.yaml @@ -331,7 +331,7 @@ jobs: PYTHON_VERSION="$(python3 -c "from pathlib import Path; import re, tomllib, sys; pyproject = tomllib.loads(Path('backend/pyproject.toml').read_text()); requires_python = pyproject['project']['requires-python']; match = re.search(r'([0-9]+[.][0-9]+)', requires_python); sys.exit('could not derive backend Python version') if not match else None; print(match.group(1))")" - NODE_MAJOR="$(node -p "const pkg = require('./frontend/package.json'); const match = String(pkg.engines?.node ?? '').match(/(\\d+)/); if (!match) throw new Error('could not derive frontend Node major'); process.stdout.write(match[1])")" + NODE_MAJOR="$(node -p "const pkg = require('./frontend/package.json'); const match = String(pkg.engines?.node ?? '').match(/(\\d+)/); if (!match) throw new Error('could not derive frontend Node major'); match[1]")" PLAYWRIGHT_BROWSERS_MIRROR_TAG="${GITEA_REGISTRY}/${PLAYWRIGHT_MIRROR_IMAGE}" PLAYWRIGHT_BROWSERS_UPSTREAM_TAG="${PLAYWRIGHT_IMAGE}" @@ -1107,8 +1107,8 @@ jobs: FRONTEND_BASE_TAG_REF="${FRONTEND_BASE_REPO}:${HEAD_SHA}" FRONTEND_BASE_CACHE_REF="${FRONTEND_BASE_REPO}:cache" - NODE_ALPINE_TAG="$(node -p "const pkg = require('./frontend/package.json'); const match = String(pkg.engines?.node ?? '').match(/(\\d+)/); if (!match) throw new Error('could not derive frontend Node major'); process.stdout.write(match[1] + '-alpine')")" - YARN_VERSION="$(node -p "const pkg = require('./frontend/package.json'); const match = String(pkg.packageManager ?? '').match(/^yarn@(.*)$/); if (!match) throw new Error('could not derive frontend Yarn version'); process.stdout.write(match[1])")" + NODE_ALPINE_TAG="$(node -p "const pkg = require('./frontend/package.json'); const match = String(pkg.engines?.node ?? '').match(/(\\d+)/); if (!match) throw new Error('could not derive frontend Node major'); match[1] + '-alpine'")" + YARN_VERSION="$(node -p "const pkg = require('./frontend/package.json'); const match = String(pkg.packageManager ?? '').match(/^yarn@(.*)$/); if (!match) throw new Error('could not derive frontend Yarn version'); match[1]")" retry_registry_op pull "${FRONTEND_BASE_CACHE_REF}" 5 3 || true BUILDKIT_NO_CLIENT_TOKEN=1 DOCKER_BUILDKIT=1 docker build -f Dockerfile.frontend \ @@ -1303,8 +1303,8 @@ jobs: DEPLOYABLE_FRONTEND_TAG_REF="${DEPLOYABLE_FRONTEND_REPO}:${HEAD_SHA}" DEPLOYABLE_FRONTEND_CACHE_REF="${DEPLOYABLE_FRONTEND_REPO}:cache" - NODE_ALPINE_TAG="$(node -p "const pkg = require('./frontend/package.json'); const match = String(pkg.engines?.node ?? '').match(/(\\d+)/); if (!match) throw new Error('could not derive frontend Node major'); process.stdout.write(match[1] + '-alpine')")" - YARN_VERSION="$(node -p "const pkg = require('./frontend/package.json'); const match = String(pkg.packageManager ?? '').match(/^yarn@(.*)$/); if (!match) throw new Error('could not derive frontend Yarn version'); process.stdout.write(match[1])")" + NODE_ALPINE_TAG="$(node -p "const pkg = require('./frontend/package.json'); const match = String(pkg.engines?.node ?? '').match(/(\\d+)/); if (!match) throw new Error('could not derive frontend Node major'); match[1] + '-alpine'")" + YARN_VERSION="$(node -p "const pkg = require('./frontend/package.json'); const match = String(pkg.packageManager ?? '').match(/^yarn@(.*)$/); if (!match) throw new Error('could not derive frontend Yarn version'); match[1]")" docker_login_with_retry 5 3 retry_registry_op pull "${DEPLOYABLE_FRONTEND_CACHE_REF}" 5 3 || true diff --git a/Dockerfile.cicd-base b/Dockerfile.cicd-base index 34dcb96..a64aee0 100644 --- a/Dockerfile.cicd-base +++ b/Dockerfile.cicd-base @@ -128,7 +128,7 @@ RUN for i in 1 2 3; do \ https://deb.nodesource.com/setup_${NODE_MAJOR}.x | bash - && \ find /etc/apt -type f \( -name 'sources.list' -o -name '*.sources' -o -name '*.list' \) -print0 | xargs -0 sed -i 's|http://|https://|g' && \ apt-get update && \ - timeout 300 apt-get install -y --no-install-recommends nodejs && \ + timeout 300 apt-get install -y --no-install-recommends nodejs npm && \ break || \ (echo "Attempt $i failed, retrying in 15s..." && sleep 15); \ done && \