Skip to content

Commit

Permalink
배포 스크립트 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
EC2 Default User committed Nov 12, 2022
1 parent e38bd7d commit 48c4da8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,31 @@
REPOSITORY=/home/ec2-user
PROJECT_NAME=CoTEVer-Server

rm ../nohup.out

sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-ports 8080

cd $REPOSITORY/$PROJECT_NAME/

echo "> Git Pull"

git pull

./gradlew build
gradle build -x test

cd $REPOSITORY

cp $REPOSITORY/$PROJECT_NAME/build/libs/*.jar $REPOSITORY/
cp $REPOSITORY/$PROJECT_NAME/build/libs/CoTEVer-0.0.1-SNAPSHOT.jar $REPOSITORY/

CURRENT_PID=$(pgrep -f CoTEVer-0.0.1-SNAPSHOT.jar)

CURRENT_PID = $(pgrep -f ${PROJECT_NAME}.*.jar)
echo " 현재 구동중인 애플리케이션pid: $CURRENT_PID"

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

Expand Down

0 comments on commit 48c4da8

Please sign in to comment.