Skip to content

Commit

Permalink
Create start_server.sh (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
thalals authored Feb 29, 2024
1 parent 51ea972 commit 817759a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions start_server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#! /bin/sh

echo "Java Version"
java -version

echo "Start Spring Boot Application!"
CURRENT_PID=$(ps -ef | grep api-0.0.1-SNAPSHOT.jar | grep java | awk '{print $2}')

echo $CURRENT_PID

if [ -z $CURRENT_PID ]; then
echo ">현재 구동중인 어플리케이션이 없으므로 종료하지 않습니다."

else
echo "> kill -15 $CURRENT_PID"
kill -15 $CURRENT_PID
sleep 10
fi

echo ">어플리케이션 배포 진행!"

nohup java -jar ~/deploy/build/libs/api-0.0.1-SNAPSHOT.jar >> ~/deploy/logs/$(date '+%Y-%m-%d')_api.log 2>&1 &

0 comments on commit 817759a

Please sign in to comment.