Jenkins build
Some checks failed
test/timeline-frontend/pipeline/head There was a failure building this commit

This commit is contained in:
2025-12-29 15:35:36 +08:00
parent 2b63c3f026
commit 60c3cd2332

12
Jenkinsfile vendored
View File

@@ -45,13 +45,15 @@ pipeline {
// 确保路径正确
sh "ls -la ${workspace}"
sh "npm -v"
sh "npm install && npm run build"
// 修复权限问题
sh "chmod -R 755 ${workspace}"
sh "chown -R jenkins:jenkins ${workspace}"
// 使用绝对路径挂载工作目录到容器中,并确保所有命令都在容器内执行
sh 'docker run --rm -v "${PWD}:/app" -w /app node:18-alpine sh -c \'if [ -f "package.json" ]; then echo "package.json found"; npm install && npm run build; else echo "package.json not found"; exit 1; fi\''
// sh "chmod -R 755 ${workspace}"
// sh "chown -R jenkins:jenkins ${workspace}"
//
// // 使用绝对路径挂载工作目录到容器中,并确保所有命令都在容器内执行
// sh 'docker run --rm -v "${PWD}:/app" -w /app node:18-alpine sh -c \'if [ -f "package.json" ]; then echo "package.json found"; npm install && npm run build; else echo "package.json not found"; exit 1; fi\''
// 检查构建是否生成了 dist 目录
sh 'ls -la'