Expose migration bootstrap secret for export job
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
Codex
2026-04-29 14:50:21 +08:00
parent 973f67b6ba
commit 5bf2058f8b
2 changed files with 5 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ pipeline {
string(name: 'DEPLOY_DIRECTORY', defaultValue: '/var/lib/jenkins/deploy/Genarrative', description: '固定部署目录ROOT_DIR 为空时使用其 .spacetimedb') string(name: 'DEPLOY_DIRECTORY', defaultValue: '/var/lib/jenkins/deploy/Genarrative', description: '固定部署目录ROOT_DIR 为空时使用其 .spacetimedb')
string(name: 'ROOT_DIR', defaultValue: '', description: 'spacetime CLI root-dir可选优先于 DEPLOY_DIRECTORY') string(name: 'ROOT_DIR', defaultValue: '', description: 'spacetime CLI root-dir可选优先于 DEPLOY_DIRECTORY')
string(name: 'INCLUDE_TABLES', defaultValue: '', description: '可选,逗号分隔的表名白名单') string(name: 'INCLUDE_TABLES', defaultValue: '', description: '可选,逗号分隔的表名白名单')
string(name: 'BOOTSTRAP_SECRET', defaultValue: '', description: '可选,授权临时导出 identity 的迁移引导密钥')
string(name: 'OUTPUT_DIRECTORY', defaultValue: 'database-exports', description: '导出文件目录,相对源码根目录或绝对路径') string(name: 'OUTPUT_DIRECTORY', defaultValue: 'database-exports', description: '导出文件目录,相对源码根目录或绝对路径')
string(name: 'EXPORT_NAME', defaultValue: '', description: '导出文件名,留空则自动使用构建号') string(name: 'EXPORT_NAME', defaultValue: '', description: '导出文件名,留空则自动使用构建号')
} }
@@ -72,6 +73,9 @@ pipeline {
if [[ -n "${params.INCLUDE_TABLES}" ]]; then if [[ -n "${params.INCLUDE_TABLES}" ]]; then
args+=(--include "${params.INCLUDE_TABLES}") args+=(--include "${params.INCLUDE_TABLES}")
fi fi
if [[ -n "${params.BOOTSTRAP_SECRET}" ]]; then
args+=(--bootstrap-secret "${params.BOOTSTRAP_SECRET}")
fi
# 复用后端迁移 procedure 导出 JSON避免 Jenkins 直接拼接表结构和 SQL。 # 复用后端迁移 procedure 导出 JSON避免 Jenkins 直接拼接表结构和 SQL。
node "\${args[@]}" node "\${args[@]}"
test -s "\${output_path}" test -s "\${output_path}"

View File

@@ -112,6 +112,7 @@ DEPLOY_ITEMS=(
".env.local" ".env.local"
"README.md" "README.md"
"api-server" "api-server"
"migration-bootstrap-secret.txt"
"spacetime_module.wasm" "spacetime_module.wasm"
"start.sh" "start.sh"
"stop.sh" "stop.sh"