Skip to content

Commit

Permalink
chore: 배포 스크립트 작성 #84
Browse files Browse the repository at this point in the history
  • Loading branch information
chaewss committed Jul 27, 2023
1 parent e4b3241 commit 68642f7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

PROJECT_ROOT="/home/ubuntu/cvs-go-server"
JAR_FILE="$PROJECT_ROOT/cvsgo-0.0.1-SNAPSHOT.jar"

# 현재 구동 중인 애플리케이션 pid 확인
CURRENT_PID=$(pgrep -f $JAR_NAME)

# 프로세스가 켜져 있을 경우 종료
if [ -z $CURRENT_PID ]; then
echo "> NOT RUNNING"
else
echo "> kill -15 $CURRENT_PID"
kill -15 $CURRENT_PID
sleep 5
fi

# build 파일 복사
cp $PROJECT_ROOT/build/libs/cvsgo-0.0.1-SNAPSHOT.jar $JAR_FILE

# jar 파일 실행
echo "> deploy $JAR_FILE"
nohup java -jar $JAR_FILE &

0 comments on commit 68642f7

Please sign in to comment.