Skip to content

Commit

Permalink
feat: deploy shell
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools committed Jul 9, 2024
1 parent 00f9b5f commit 0427bb1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

REPOSITORY=/home/ubuntu/IT-Pick-Backend
cd $REPOSITORY

APP_NAME=moduform
JAR_NAME=$(ls $REPOSITORY/build/libs/ | grep 'SNAPSHOT.jar' | tail -n 1)
JAR_PATH=$REPOSITORY/build/libs/$JAR_NAME

CURRENT_PID=$(pgrep -f $APP_NAME)

if [ -z $CURRENT_PID ]
then
echo "> 종료할 애플리케이션이 없습니다."
else
echo "> kill -9 $CURRENT_PID"
kill -15 $CURRENT_PID
sleep 5
fi

echo "> Deploy - $JAR_PATH "
nohup java -jar $JAR_PATH > /dev/null 2> /dev/null < /dev/null &

0 comments on commit 0427bb1

Please sign in to comment.