This commit is contained in:
2026-08-24 12:01:37 +08:00
parent d59fccc731
commit f1639b9fe3
2 changed files with 6 additions and 13 deletions
Vendored
-13
View File
@@ -60,7 +60,6 @@ pipeline {
booleanParam(name: 'SERVICE_AUDIT', defaultValue: false, description: '审计服务(audit-service)')
choice(name: 'ENVIRONMENT', choices: environmentChoicesForJob(env.JOB_BASE_NAME), description: '部署环境')
booleanParam(name: 'DEPLOY', defaultValue: false, description: '各服务构建成功后是否独立部署')
booleanParam(name: 'INITIALIZE_TEST_DATABASE', defaultValue: false, description: '仅 test:调度服务前幂等初始化测试数据库')
booleanParam(name: 'SKIP_TESTS', defaultValue: false, description: '是否跳过测试;生产构建不建议勾选')
string(name: 'IMAGE_REPOSITORY', defaultValue: '172.31.198.7:10082/java-project/baiyue-firstleg', description: '内网共享镜像仓库地址')
string(name: 'DOCKER_BASE_IMAGE', defaultValue: '172.31.198.7:10082/java-project/eclipse-temurin:17-jre-alpine', description: '内网 Java 17 基础镜像')
@@ -165,18 +164,6 @@ pipeline {
}
}
stage('测试数据库初始化(可选)') {
when {
allOf {
expression { env.RESOLVED_ENVIRONMENT == 'test' && params.INITIALIZE_TEST_DATABASE }
}
}
agent { label 'java-test' }
steps {
sh 'sh deploy/scripts/initialize-test-databases.sh'
}
}
stage('并行调度独立服务 Job') {
when { expression { env.NO_SERVICE_CHANGE != 'true' } }
steps {
@@ -23,3 +23,9 @@ test('database-only changes are reported as a separate migration action', () =>
assert.match(pipeline, /仅数据库迁移变更 \| 需单独审核执行/)
assert.match(pipeline, /统一 SQL 须独立审核并执行/)
})
test('coordinator cannot initialize test databases', () => {
assert.doesNotMatch(pipeline, /INITIALIZE_TEST_DATABASE/)
assert.doesNotMatch(pipeline, /initialize-test-databases\.sh/)
assert.doesNotMatch(pipeline, /测试数据库初始化/)
})