Skip to content

Commit

Permalink
deploy 스크립트 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
EC2 Default User committed Nov 8, 2022
1 parent 806eb7b commit c153fe1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

REPOSITORY=/home/ec2-user
PROJECT_NAME=CoTEVer-Server

cd $REPOSITORY/$PROJECT_NAME/

echo "> Git Pull"

git pull

./gradlew build

cd $REPOSITORY

cp $REPOSITORY/$PROJECT_NAME/build/libs/*.jar $REPOSITORY/

CURRENT_PID = $(pgrep -f ${PROJECT_NAME}.*.jar)

if [ -z "$CURRENT_PID" ]; then
echo "> 현재 구동중인 서버가 없음"
else
kill -15 $CURRENT_PID
sleep 5
fi

JAR_NAME=$(ls -tr $REPOSITORY/ | grep jar | head -n 1)

nohup java -jar $REPOSITORY/$JAR_NAME 2>&1 &
Empty file modified gradlew
100644 → 100755
Empty file.

0 comments on commit c153fe1

Please sign in to comment.