쉘 추가

This commit is contained in:
익희 김 2024-12-05 22:11:23 +09:00
parent b9056611c4
commit bbb620ff63

23
deploy.sh Normal file
View File

@ -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!"