ktworkflow-mcp/ci/jenkins/KT-NapCatQQ-Upstream-Sync.Jenkinsfile

52 lines
1.6 KiB
Plaintext

pipeline {
agent any
options {
skipDefaultCheckout(true)
timestamps()
timeout(time: 30, unit: 'MINUTES')
}
parameters {
booleanParam(name: 'RUN_CODEX_AUDIT', defaultValue: false, description: 'When true, allow the optional Codex workspace-write audit after the default dry-run audit.')
string(name: 'CONFIRM_CODEX_WORKSPACE_WRITE', defaultValue: '', description: 'Type RUN_CODEX_WORKSPACE_WRITE_AUDIT to confirm Codex may run with a workspace-write sandbox.')
}
environment {
KT_WORKFLOW_DIR = '/vol1/docker/kt-codex/workspace/KT/mcp/ktWorkflow'
KT_ARTIFACT_ROOT = '/vol1/docker/kt-codex/artifacts'
}
stages {
stage('ktWorkflow upstream audit dry-run') {
steps {
sh '''
set -e
pnpm --dir "$KT_WORKFLOW_DIR" run napcat-upstream-audit -- \
--artifact-root "$KT_ARTIFACT_ROOT/napcat-upstream-sync/dry-run"
'''
}
}
stage('ktWorkflow upstream audit with Codex') {
when {
expression { return params.RUN_CODEX_AUDIT }
}
steps {
script {
if (params.CONFIRM_CODEX_WORKSPACE_WRITE != 'RUN_CODEX_WORKSPACE_WRITE_AUDIT') {
error('CONFIRM_CODEX_WORKSPACE_WRITE must equal RUN_CODEX_WORKSPACE_WRITE_AUDIT before Codex workspace-write audit runs.')
}
}
sh '''
set -e
pnpm --dir "$KT_WORKFLOW_DIR" run napcat-upstream-audit -- \
--execute \
--use-codex \
--artifact-root "$KT_ARTIFACT_ROOT/napcat-upstream-sync/codex"
'''
}
}
}
}