Jenkins build
Some checks failed
test/timeline-frontend/pipeline/head There was a failure building this commit
Some checks failed
test/timeline-frontend/pipeline/head There was a failure building this commit
This commit is contained in:
12
Jenkinsfile
vendored
12
Jenkinsfile
vendored
@@ -52,17 +52,7 @@ pipeline {
|
|||||||
sh "chown -R jenkins:jenkins ${workspace}"
|
sh "chown -R jenkins:jenkins ${workspace}"
|
||||||
|
|
||||||
// 使用更健壮的Docker命令
|
// 使用更健壮的Docker命令
|
||||||
sh '''docker run --rm -v "$(pwd)":/app -w /app node:18-alpine sh -c "
|
sh """docker run --rm -v ${workspace}:/app -w /app node:18-alpine sh -c 'ls -la && if [ -f package.json ]; then npm install && npm run build; else echo "package.json not found"; exit 1; fi'"""
|
||||||
ls -la
|
|
||||||
if [ -f package.json ]; then
|
|
||||||
echo 'package.json found'
|
|
||||||
npm ci
|
|
||||||
npm run build
|
|
||||||
else
|
|
||||||
echo 'package.json not found in /app'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
"'''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user