-
Notifications
You must be signed in to change notification settings - Fork 2
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
손명진
authored and
손명진
committed
Jul 29, 2024
1 parent
0a3c6d7
commit b780731
Showing
3 changed files
with
41 additions
and
1 deletion.
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
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 | ||
|
||
echo "> Checking pid of the running application..." | ||
|
||
APP_BASE_PATH=/home/ubuntu/app/ | ||
|
||
CURRENT_PID=$(pgrep -f i-like-this-page) | ||
|
||
echo "PID = $CURRENT_PID" | ||
|
||
if [ -z $CURRENT_PID ]; then | ||
echo "> There is no running application." | ||
else | ||
echo "> kill -15 $CURRENT_PID" | ||
kill -15 $CURRENT_PID | ||
sleep 5 | ||
fi | ||
|
||
echo "> Deploying a new application..." | ||
|
||
echo "> Copy jar files" | ||
|
||
cp $APP_BASE_PATH/deploy/build/libs/*.jar $APP_BASE_PATH/jar/ | ||
|
||
JAR_NAME=$(ls -tr $APP_BASE_PATH/jar/ | grep 'i-like-this-page' | tail -n 1) | ||
|
||
echo "> JAR Name: $JAR_NAME" | ||
|
||
nohup java -jar $APP_BASE_PATH/jar/$JAR_NAME & |
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,5 @@ | ||
#!/bin/bash | ||
|
||
touch /home/ubuntu/deploy.log | ||
|
||
/home/ubuntu/deploy.sh > /home/ubuntu/deploy.log 2> /home/ubuntu/deploy.log < /dev/null & |