chore: [deploy] Next.js 빌드 캐시 보존으로 빌드 시간 단축
- checkout 전 .next/cache 백업 → checkout 후 복원 - 증분 빌드 활성화 (변경된 파일만 재컴파일) - 예상: 101초 → 30~50초
This commit is contained in:
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@@ -71,11 +71,15 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
// ── 일반 배포: Checkout ──
|
||||
// ── 일반 배포: Checkout (빌드 캐시 보존) ──
|
||||
stage('Checkout') {
|
||||
when { expression { params.ACTION == 'deploy' } }
|
||||
steps {
|
||||
// .next/cache 백업 (증분 빌드용)
|
||||
sh 'rm -rf /tmp/.next-cache-backup && [ -d .next/cache ] && cp -r .next/cache /tmp/.next-cache-backup || true'
|
||||
checkout scm
|
||||
// .next/cache 복원
|
||||
sh 'mkdir -p .next && [ -d /tmp/.next-cache-backup ] && cp -r /tmp/.next-cache-backup .next/cache && rm -rf /tmp/.next-cache-backup || true'
|
||||
script {
|
||||
env.GIT_COMMIT_MSG = sh(script: "git log -1 --pretty=format:'%s'", returnStdout: true).trim()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user