fix(ci): rsync trailing slash 수정 및 PM2 프로세스명 수정

- rsync source 경로 trailing slash 제거 (.next/, node_modules/, public/ → .next, node_modules, public)
- trailing slash로 디렉토리 내용이 root에 풀리는 문제 해결
- dev deploy에 --exclude .git, .env*, ecosystem.config.* 추가
- PM2 프로세스명: sam-front → sam-react (개발서버)
This commit is contained in:
2026-02-24 02:22:36 +09:00
parent ec492e3829
commit 6a469181cd

15
Jenkinsfile vendored
View File

@@ -39,12 +39,15 @@ pipeline {
sshagent(credentials: ['deploy-ssh-key']) {
sh """
rsync -az --delete \
.next/ package.json package-lock.json next.config.ts public/ node_modules/ \
--exclude='.git' \
--exclude='.env*' \
--exclude='ecosystem.config.*' \
.next package.json next.config.ts public node_modules \
${DEPLOY_USER}@114.203.209.83:/home/webservice/react/
scp .env.local ${DEPLOY_USER}@114.203.209.83:/home/webservice/react/.env.local
ssh ${DEPLOY_USER}@114.203.209.83 'cd /home/webservice/react && pm2 restart sam-front'
ssh ${DEPLOY_USER}@114.203.209.83 'cd /home/webservice/react && pm2 restart sam-react'
"""
}
}
@@ -59,7 +62,7 @@ pipeline {
ssh ${DEPLOY_USER}@211.117.60.189 'mkdir -p /home/webservice/react-stage/releases/${RELEASE_ID}'
rsync -az --delete \
.next/ package.json package-lock.json next.config.ts public/ node_modules/ \
.next package.json next.config.ts public node_modules \
${DEPLOY_USER}@211.117.60.189:/home/webservice/react-stage/releases/${RELEASE_ID}/
scp .env.local ${DEPLOY_USER}@211.117.60.189:/home/webservice/react-stage/releases/${RELEASE_ID}/.env.local
@@ -83,7 +86,7 @@ pipeline {
ssh ${DEPLOY_USER}@211.117.60.189 'mkdir -p /home/webservice/react/releases/${RELEASE_ID}'
rsync -az --delete \
.next/ package.json package-lock.json next.config.ts public/ node_modules/ \
.next package.json next.config.ts public node_modules \
${DEPLOY_USER}@211.117.60.189:/home/webservice/react/releases/${RELEASE_ID}/
scp .env.local ${DEPLOY_USER}@211.117.60.189:/home/webservice/react/releases/${RELEASE_ID}/.env.local
@@ -100,7 +103,7 @@ pipeline {
}
post {
success { echo "✅ react 배포 완료 (${env.BRANCH_NAME})" }
failure { echo "❌ react 배포 실패 (${env.BRANCH_NAME})" }
success { echo '✅ react 배포 완료 (' + env.BRANCH_NAME + ')' }
failure { echo '❌ react 배포 실패 (' + env.BRANCH_NAME + ')' }
}
}