From bbb620ff630281d22a811c8aabfb8c0632238042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B5=ED=9D=AC=20=EA=B9=80?= Date: Thu, 5 Dec 2024 22:11:23 +0900 Subject: [PATCH] =?UTF-8?q?=EC=89=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..0892580 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# PM2에서 'front' 애플리케이션 중지 +echo "Stopping PM2 application 'front'..." +pm2 stop front + +# Git에서 최신 코드 가져오기 +echo "Pulling latest code from git..." +git pull + +# NPM 빌드 실행 +echo "Building application..." +npm run build + +# PM2에서 'front' 애플리케이션 삭제 +echo "Deleting old PM2 application 'front'..." +pm2 del front + +# PM2로 애플리케이션 재시작 +echo "Starting PM2 application 'front'..." +pm2 start npm --name "front" -- start + +echo "Deployment completed!"