fix web deploy artifact source

This commit is contained in:
2026-06-01 13:12:46 +00:00
parent 4796cff56f
commit 5354268529
5 changed files with 22 additions and 86 deletions

View File

@@ -12,7 +12,6 @@ pipeline {
environment {
GIT_REMOTE_URL = 'http://127.0.0.1:3000/GenarrativeAI/Genarrative.git'
GIT_REMOTE_FALLBACK_URL = 'https://git.genarrative.world/GenarrativeAI/Genarrative.git'
WEB_ARTIFACT_ROOT = 'caches/genarrative-build/web-artifacts'
}
parameters {
@@ -90,33 +89,7 @@ pipeline {
stage('Archive') {
steps {
sh '''
bash -lc '
set -euo pipefail
web_artifact_root="${WEB_ARTIFACT_ROOT:-caches/genarrative-build/web-artifacts}"
if [[ "${web_artifact_root}" != /* ]]; then
web_artifact_root="${HOME:?HOME 不能为空}/${web_artifact_root}"
fi
artifact_dir="${web_artifact_root}/${JOB_NAME}/${BUILD_NUMBER}/${EFFECTIVE_BUILD_VERSION}"
mkdir -p "${artifact_dir}"
rm -f "${artifact_dir}/web.tar.gz" "${artifact_dir}/web.tar.gz.sha256" "${artifact_dir}/release-manifest.json"
install -m 0644 "build/${EFFECTIVE_BUILD_VERSION}/web.tar.gz" "${artifact_dir}/web.tar.gz"
install -m 0644 "build/${EFFECTIVE_BUILD_VERSION}/web.tar.gz.sha256" "${artifact_dir}/web.tar.gz.sha256"
install -m 0644 "build/${EFFECTIVE_BUILD_VERSION}/release-manifest.json" "${artifact_dir}/release-manifest.json"
cat >"build/${EFFECTIVE_BUILD_VERSION}/web-artifact-pointer.txt" <<EOF
WEB_ARTIFACT_DIR=${artifact_dir}
WEB_ARTIFACT_JOB=${JOB_NAME}
WEB_ARTIFACT_BUILD_NUMBER=${BUILD_NUMBER}
WEB_ARTIFACT_VERSION=${EFFECTIVE_BUILD_VERSION}
EOF
echo "[web-build] Web 大包已保存在构建机本地目录: ${artifact_dir}"
find "${web_artifact_root}/${JOB_NAME}" -mindepth 1 -maxdepth 1 -type d -mtime +14 -print -exec rm -rf {} +
'
'''
archiveArtifacts artifacts: "build/${env.EFFECTIVE_BUILD_VERSION}/web.tar.gz.sha256,build/${env.EFFECTIVE_BUILD_VERSION}/release-manifest.json,build/${env.EFFECTIVE_BUILD_VERSION}/web-artifact-pointer.txt", fingerprint: false
archiveArtifacts artifacts: "build/${env.EFFECTIVE_BUILD_VERSION}/web.tar.gz,build/${env.EFFECTIVE_BUILD_VERSION}/web.tar.gz.sha256,build/${env.EFFECTIVE_BUILD_VERSION}/release-manifest.json", fingerprint: true
}
}