From 90c3630a4243d58ba7dd8fdff46e711babeea396 Mon Sep 17 00:00:00 2001 From: jisangs Date: Sat, 12 Sep 2026 22:27:24 +0900 Subject: [PATCH] =?UTF-8?q?Jenkins=20production=20=ED=99=98=EA=B2=BD=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95,=20=ED=99=95=EC=9D=B8?= =?UTF-8?q?=20=EB=8B=A8=EA=B3=84=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/prod-jenkins/Jenkinsfile | 8 -------- deploy/prod-jenkins/remote_deploy.sh | 14 +++++++------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/deploy/prod-jenkins/Jenkinsfile b/deploy/prod-jenkins/Jenkinsfile index 52528ec..4209677 100644 --- a/deploy/prod-jenkins/Jenkinsfile +++ b/deploy/prod-jenkins/Jenkinsfile @@ -15,14 +15,6 @@ pipeline { sh 'chmod +x ${DEPLOY_DIR}/*.sh && ./${DEPLOY_DIR}/package.sh' } } - stage('Confirm Production') { - steps { - input( - message: "Production 서버(${env.SSH_TARGET})로 배포하시겠습니까?", - ok: 'Deploy' - ) - } - } stage('Upload') { steps { sh ''' diff --git a/deploy/prod-jenkins/remote_deploy.sh b/deploy/prod-jenkins/remote_deploy.sh index 094c2a1..348ab58 100644 --- a/deploy/prod-jenkins/remote_deploy.sh +++ b/deploy/prod-jenkins/remote_deploy.sh @@ -8,7 +8,7 @@ ARCHIVE_NAME="$1" PROD_TMP_DIR="/tmp/chocomae-deploy" PROD_BACKUP_DIR="/var/backups/chocomae" PROD_HTML_ROOT="/var/www/html" -PROD_DEPLOY_DIR="${PROD_HTML_ROOT}/mouse-typing" +PROD_DEPLOY_DIR="${PROD_HTML_ROOT}/mouse_typing" TIMESTAMP=$(date +%Y%m%d%H%M%S) NEW_DIR="${PROD_DEPLOY_DIR}_new" @@ -58,14 +58,14 @@ sudo bash -c "ls -t ${PROD_BACKUP_DIR}/chocomae-prod-backup-*.tar.gz 2>/dev/null # ---------- 3. 순간 교체 ---------- echo "=== [4/4] 디렉토리 스왑 ===" -#if sudo test -d "${PROD_DEPLOY_DIR}"; then -# sudo mv "${PROD_DEPLOY_DIR}" "${OLD_DIR}" -#fi -#sudo mv "${NEW_DIR}" "${PROD_DEPLOY_DIR}" -#SWAPPED=1 +if sudo test -d "${PROD_DEPLOY_DIR}"; then + sudo mv "${PROD_DEPLOY_DIR}" "${OLD_DIR}" +fi +sudo mv "${NEW_DIR}" "${PROD_DEPLOY_DIR}" +SWAPPED=1 # index.html은 html 루트에 위치 -#sudo mv -v "${PROD_DEPLOY_DIR}/index.html" "${PROD_HTML_ROOT}/index.html" +sudo mv -v "${PROD_DEPLOY_DIR}/index.html" "${PROD_HTML_ROOT}/index.html" # ---------- 4. 정리 ---------- echo "=== 정리 ==="