移除 root 相关修改,恢复原始 Jenkinsfile

This commit is contained in:
2026-05-30 09:52:45 +08:00
parent 43d3dbde2c
commit 29db5a4c30
Vendored
+2 -4
View File
@@ -10,13 +10,12 @@ pipeline {
agent { agent {
docker { docker {
image 'node:20-alpine' image 'node:20-alpine'
args '-u root -v ${WORKSPACE}/.npm:/.npm -v ${WORKSPACE}/node_modules:/app/node_modules' args '-v ${WORKSPACE}/.npm:/.npm -v ${WORKSPACE}/node_modules:/app/node_modules'
} }
} }
steps { steps {
sh ''' sh '''
npm config set cache /.npm npm config set cache /.npm
chown -R $(id -u):$(id -g) /.npm 2>/dev/null || true
npm install npm install
''' '''
} }
@@ -26,12 +25,11 @@ pipeline {
agent { agent {
docker { docker {
image 'node:20-alpine' image 'node:20-alpine'
args '-u root -v ${WORKSPACE}/.npm:/.npm -v ${WORKSPACE}/node_modules:/app/node_modules' args '-v ${WORKSPACE}/.npm:/.npm -v ${WORKSPACE}/node_modules:/app/node_modules'
} }
} }
steps { steps {
sh ''' sh '''
chown -R $(id -u):$(id -g) /.npm 2>/dev/null || true
npm run type-check npm run type-check
npm run build npm run build
''' '''