-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
EC2 Default User
committed
Nov 8, 2022
1 parent
806eb7b
commit c153fe1
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 & |