From 6a469181cdc1a6b3b3f25878c8dcb7b5b5b14752 Mon Sep 17 00:00:00 2001 From: DEV-SERVER Date: Tue, 24 Feb 2026 02:22:36 +0900 Subject: [PATCH] =?UTF-8?q?fix(ci):=20rsync=20trailing=20slash=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EB=B0=8F=20PM2=20=ED=94=84=EB=A1=9C=EC=84=B8?= =?UTF-8?q?=EC=8A=A4=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 (개발서버) --- Jenkinsfile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ead090bf..a0789999 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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 + ')' } } }