fix: rebuild CI/CD pipeline with persistent npm cache

This commit is contained in:
2026-08-04 14:21:26 +00:00
parent 95aae8a63a
commit bbab18351b

21
Jenkinsfile vendored
View File

@@ -36,7 +36,6 @@ pipeline {
test -f frontend/package-lock.json
test -f deploy/dev/docker-compose.yml
echo "Commit : ${GIT_COMMIT}"
echo "Tag Docker : ${IMAGE_TAG}"
'''
}
@@ -75,16 +74,22 @@ pipeline {
docker run --rm \
--network "${CI_NETWORK}" \
--volumes-from furious-jenkins \
-v tiptop-npm-cache-backend:/npm-cache \
--user "$(id -u):$(id -g)" \
-e HOME=/tmp \
-e NPM_CONFIG_CACHE=/tmp/.npm \
-e NODE_OPTIONS=--dns-result-order=ipv4first \
-e NPM_CONFIG_CACHE=/npm-cache \
-e NPM_CONFIG_FETCH_RETRIES=5 \
-e NPM_CONFIG_FETCH_RETRY_MINTIMEOUT=20000 \
-e NPM_CONFIG_FETCH_RETRY_MAXTIMEOUT=120000 \
-e NPM_CONFIG_FETCH_TIMEOUT=600000 \
-e DATABASE_URL="${DATABASE_URL}" \
-e JWT_SECRET=jenkins_ci_secret \
-e NODE_ENV=test \
-w "${WORKSPACE}/backend" \
node:22-alpine \
sh -c "
npm ci &&
npm ci --prefer-offline --no-audit --no-fund &&
npx prisma generate &&
npx prisma migrate deploy &&
npm test
@@ -98,13 +103,19 @@ pipeline {
sh '''
docker run --rm \
--volumes-from furious-jenkins \
-v tiptop-npm-cache-frontend:/npm-cache \
--user "$(id -u):$(id -g)" \
-e HOME=/tmp \
-e NPM_CONFIG_CACHE=/tmp/.npm \
-e NODE_OPTIONS=--dns-result-order=ipv4first \
-e NPM_CONFIG_CACHE=/npm-cache \
-e NPM_CONFIG_FETCH_RETRIES=5 \
-e NPM_CONFIG_FETCH_RETRY_MINTIMEOUT=20000 \
-e NPM_CONFIG_FETCH_RETRY_MAXTIMEOUT=120000 \
-e NPM_CONFIG_FETCH_TIMEOUT=600000 \
-w "${WORKSPACE}/frontend" \
node:22-alpine \
sh -c "
npm ci &&
npm ci --prefer-offline --no-audit --no-fund &&
npm run lint &&
npm run build
"