chore: move jenkins caches under home

This commit is contained in:
2026-06-01 06:30:49 +00:00
parent 6cd554473b
commit 751c742b0f
4 changed files with 23 additions and 10 deletions

View File

@@ -12,11 +12,9 @@ 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'
CARGO_HOME = '/home/dsk/.cache/genarrative-jenkins/api-server/cargo-home'
CARGO_TARGET_DIR = '/home/dsk/.cache/genarrative-jenkins/api-server/cargo-target/prod-release'
GENARRATIVE_API_CACHE_ROOT = 'caches/genarrative-jenkins/api-server'
CARGO_INCREMENTAL = '0'
RUSTC_WRAPPER = 'sccache'
SCCACHE_DIR = '/home/dsk/.cache/genarrative-jenkins/api-server/sccache'
SCCACHE_CACHE_SIZE = '30G'
}
@@ -80,6 +78,13 @@ pipeline {
sh '''
bash -lc '
set -euo pipefail
api_cache_root="${GENARRATIVE_API_CACHE_ROOT:-caches/genarrative-jenkins/api-server}"
if [[ "${api_cache_root}" != /* ]]; then
api_cache_root="${HOME:?HOME 不能为空}/${api_cache_root}"
fi
export CARGO_HOME="${api_cache_root}/cargo-home"
export CARGO_TARGET_DIR="${api_cache_root}/cargo-target/prod-release"
export SCCACHE_DIR="${api_cache_root}/sccache"
chmod +x scripts/jenkins-prepare-cargo-env.sh
source scripts/jenkins-prepare-cargo-env.sh
if ! command -v clang >/dev/null 2>&1 || ! command -v lld >/dev/null 2>&1; then