优化部署
This commit is contained in:
1 parent
9b7f26f0df
commit
f851e5d3ff
2 files changed
+1
-29
No files matched your search
Vendored
-29
@@ -51,35 +51,6 @@ 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') {
|
stage('Detect Changes') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ set -e
|
|||||||
# Hxops 部署脚本 (优化版)
|
# Hxops 部署脚本 (优化版)
|
||||||
# 用途: 自动拉取代码、构建前端、重启容器
|
# 用途: 自动拉取代码、构建前端、重启容器
|
||||||
# 使用: ./deploy.sh
|
# 使用: ./deploy.sh
|
||||||
|
# 备注:该文件用于手动在服务器上执行该脚本,Jenkins自动部署已不用该文件
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
|
|
||||||
echo "🚀 开始部署 Hxops..."
|
echo "🚀 开始部署 Hxops..."
|
||||||
|
|||||||
Reference in new issue
Block a user