chore: 完善NapCat自动化Jenkins归档

This commit is contained in:
sunlei 2026-06-25 09:47:04 +08:00
parent b8b46a04c3
commit 598180615c
3 changed files with 34 additions and 0 deletions

View File

@ -2,6 +2,8 @@ pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '30', artifactNumToKeepStr: '30'))
disableConcurrentBuilds()
skipDefaultCheckout(true)
timestamps()
timeout(time: 60, unit: 'MINUTES')
@ -86,6 +88,18 @@ pipeline {
}
}
}
post {
always {
sh '''
set +e
rm -rf "$WORKSPACE/artifacts"
mkdir -p "$WORKSPACE/artifacts/napcat-runtime-release"
cp -a "$KT_ARTIFACT_ROOT/napcat-runtime-release/." "$WORKSPACE/artifacts/napcat-runtime-release/" 2>/dev/null || true
'''
archiveArtifacts artifacts: 'artifacts/napcat-runtime-release/**/*', allowEmptyArchive: true, fingerprint: false
}
}
}
/**

View File

@ -2,6 +2,8 @@ pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '30', artifactNumToKeepStr: '30'))
disableConcurrentBuilds()
skipDefaultCheckout(true)
timestamps()
timeout(time: 30, unit: 'MINUTES')
@ -48,4 +50,16 @@ pipeline {
}
}
}
post {
always {
sh '''
set +e
rm -rf "$WORKSPACE/artifacts"
mkdir -p "$WORKSPACE/artifacts/napcat-upstream-sync"
cp -a "$KT_ARTIFACT_ROOT/napcat-upstream-sync/." "$WORKSPACE/artifacts/napcat-upstream-sync/" 2>/dev/null || true
'''
archiveArtifacts artifacts: 'artifacts/napcat-upstream-sync/**/*', allowEmptyArchive: true, fingerprint: false
}
}
}

View File

@ -475,6 +475,9 @@ export async function runSelfTest(): Promise<void> {
"RUN_CODEX_AUDIT",
"CONFIRM_CODEX_WORKSPACE_WRITE",
"RUN_CODEX_WORKSPACE_WRITE_AUDIT",
"buildDiscarder(logRotator",
"disableConcurrentBuilds()",
"archiveArtifacts artifacts: 'artifacts/napcat-upstream-sync/**/*'",
]) {
if (!upstreamSyncJenkinsTemplate.includes(expected)) {
throw new Error(`NapCat upstream Jenkins template missing: ${expected}`);
@ -558,6 +561,9 @@ export async function runSelfTest(): Promise<void> {
"choice(name: 'API_PROMOTION_JOB'",
"CONFIRM_API_PROMOTION_TARGET",
"PROMOTE_KT_TEMPLATE_API_MAIN",
"buildDiscarder(logRotator",
"disableConcurrentBuilds()",
"archiveArtifacts artifacts: 'artifacts/napcat-runtime-release/**/*'",
]) {
if (!runtimeReleaseJenkinsTemplate.includes(expected)) {
throw new Error(`NapCat runtime Jenkins template missing: ${expected}`);