chore: update spacetime deploy pipeline controls

This commit is contained in:
2026-04-24 00:45:40 +08:00
parent 8df502b2a7
commit 3528980645
9 changed files with 57 additions and 15 deletions

View File

@@ -11,6 +11,7 @@ pipeline {
string(name: 'SOURCE_WORKSPACE_ROOT', defaultValue: '', description: '上游源码根目录')
string(name: 'BUILD_VERSION', defaultValue: '', description: '待部署版本号')
string(name: 'DEPLOY_DIRECTORY', defaultValue: '/var/lib/jenkins/deploy/Genarrative', description: '固定部署目录')
booleanParam(name: 'CLEAR_DATABASE', defaultValue: false, description: '部署时是否清空 SpacetimeDB 数据后再发布 wasm')
booleanParam(name: 'RUN_DEPLOY_HOOKS_WITH_SUDO', defaultValue: true, description: 'start.sh / stop.sh 是否通过 sudo -n 执行')
string(name: 'EXPECTED_UPSTREAM_JOB', defaultValue: '', description: '允许触发本作业的上游作业名')
}
@@ -88,6 +89,9 @@ pipeline {
--source-dir "build/${params.BUILD_VERSION}"
--deploy-dir "${params.DEPLOY_DIRECTORY}"
)
if [[ "${params.CLEAR_DATABASE}" == "true" ]]; then
deploy_args+=(--clear-database)
fi
if [[ "${params.RUN_DEPLOY_HOOKS_WITH_SUDO}" == "true" ]]; then
deploy_args+=(--hook-with-sudo)
fi