diff --git a/Jenkinsfile b/Jenkinsfile index cbd6b0c..5361fa2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -41,17 +41,17 @@ pipeline { steps { script { def workspace = pwd - echo "当前工作空间路径: $ {workspace}" + echo "当前工作空间路径: ${workspace}" // 确保路径正确 - sh "ls -la $ {workspace}" + sh "ls -la ${workspace}" // 修复权限问题 - sh "chmod -R 755 $ {workspace}" - sh "chown -R jenkins:jenkins $ {workspace}" + sh "chmod -R 755 ${workspace}" + sh "chown -R jenkins:jenkins ${workspace}" // 使用更健壮的Docker命令 - sh "docker run -u $ (id -u): $ (id -g) -v $ {workspace}:/app -w /app node:18-alpine sh -c 'npm install && npm run build'" + sh "docker run -u $(id -u): $(id -g) -v ${workspace}:/app -w /app node:18-alpine sh -c 'npm install && npm run build'" } } }