build: 修改frontend lint报错

This commit is contained in:
sophie committed 2026-10-15 15:13:10 +08:00
1 parent 22bee49346
commit 6c47d0639c
2 files changed
+18 -10

No files matched your search

Vendored
+12 -5
View File
@@ -360,11 +360,18 @@ pipeline {
steps {
echo '[Frontend Lint] FRONTEND_CHANGED=true,执行 npm run lint(Element 规则当前为 off)'
sh '''
set -e
docker run --rm \
-v "${WORKSPACE}:/repo" \
-w /repo \
node:22-alpine sh -c "chmod +x scripts/ci_frontend_lint.sh && ./scripts/ci_frontend_lint.sh"
set -eu
test -f "${WORKSPACE}/scripts/ci_frontend_lint.sh"
test -f "${WORKSPACE}/frontend/package.json"
# 不用 -v 挂载工作区:Jenkins 在容器里时,宿主机 Docker 看不到 /var/jenkins_home。
# 把前端源码和脚本打进容器再检查。node_modules 由容器内 npm ci 安装。
tar -C "${WORKSPACE}" \
--exclude=frontend/node_modules \
--exclude=frontend/dist \
-cf - \
frontend scripts/ci_frontend_lint.sh \
| docker run --rm -i node:22-alpine \
sh -c 'mkdir -p /repo && tar -xf - -C /repo && sh /repo/scripts/ci_frontend_lint.sh'
'''
}
}