jenkbushu

This commit is contained in:
runny committed 2026-05-13 08:47:22 +08:00
1 parent fcb70b85f4
commit 9b7f26f0df
4 files changed
+91 -5

No files matched your search

Vendored
+33 -1
View File
@@ -51,6 +51,35 @@ pipeline {
}
}
stage('Validate Docker Inputs') {
steps {
sh '''
set -e
test -f docker-compose.yml
test -f backend/Dockerfile
test -f "docs/(表+字段).md"
if grep -Eq '^docs/?$' .dockerignore 2>/dev/null && ! grep -Fxq '!docs/(表+字段).md' .dockerignore; then
echo "[Validate Docker Inputs] .dockerignore excludes docs, but docs/(表+字段).md is not re-included."
echo "[Validate Docker Inputs] Please keep docs/(表+字段).md in the Docker build context for Text2SQL."
exit 1
fi
if ! grep -Fq 'context: .' docker-compose.yml || ! grep -Fq 'dockerfile: backend/Dockerfile' docker-compose.yml; then
echo "[Validate Docker Inputs] docker-compose.yml must build hxops-backend from repository root with backend/Dockerfile."
exit 1
fi
if ! grep -Fq 'COPY docs/(表+字段).md /app/docs/(表+字段).md' backend/Dockerfile; then
echo "[Validate Docker Inputs] backend/Dockerfile must copy docs/(表+字段).md into the image."
exit 1
fi
echo "[Validate Docker Inputs] Docker build context and Text2SQL schema inputs are ready."
'''
}
}
stage('Detect Changes') {
steps {
script {
@@ -111,10 +140,13 @@ pipeline {
// 目录级变更识别:用于前后端增量构建 / Directory-level change detection for incremental builds
def frontendChanged = changedFiles.any { it.startsWith('frontend/') }
def backendChanged = changedFiles.any { it.startsWith('backend/') }
def backendChanged = changedFiles.any {
it.startsWith('backend/') || it == 'docs/(表+字段).md'
}
def deployConfigChanged = changedFiles.any {
it == 'docker-compose.yml' ||
it == 'Jenkinsfile' ||
it == '.dockerignore' ||
it == 'scripts/deploy_compose.sh' ||
it == 'scripts/healthcheck.sh' ||
it == '.env.dev' ||