-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
8 changed files
with
58 additions
and
35 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
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,12 @@ | ||
#!/bin/bash | ||
|
||
# 서버가 실행중인지 확인한다. | ||
|
||
pid=$(sudo lsof -t -i :8080) | ||
|
||
if [ -z "$pid" ]; then | ||
echo "Error: server is not running." | ||
exit 1 | ||
fi | ||
|
||
echo "PID '${pid}' is running on port 8080." |
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,15 @@ | ||
#!/bin/bash | ||
|
||
# 서버의 상태를 확인하여 실행시 실패했다면 복구한다. | ||
|
||
script_dir=$(dirname "$0") | ||
"${script_dir}/check.sh" | ||
exit_code=$? | ||
|
||
if [ $exit_code -ne 0 ]; then | ||
echo | ||
echo "========= ERROR LOG ==========" | ||
cat out.log | ||
"${script_dir}/recover.sh" | ||
exit 1 | ||
fi |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# 기존 server 프로세스를 끝낸다. | ||
|
||
pid=$(sudo lsof -t -i :8080) | ||
if [ -n "$pid" ]; then | ||
kill $pid | ||
|
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 |
---|---|---|
@@ -1,16 +1,15 @@ | ||
#!/bin/bash | ||
# | ||
# startup fresh deployed jar file | ||
|
||
script_dir=$(dirname "$0") | ||
# server.jar 로 새로운 서버 프로세스를 실행한다. | ||
|
||
"${script_dir}/runner.sh" server.jar | ||
exit_code=$? | ||
pid=$(sudo lsof -t -i :8080) | ||
|
||
if [ $exit_code -ne 0 ]; then | ||
echo "Error: there's some problems running new jar. recover backup jar." | ||
"${script_dir}/recover.sh" | ||
if [ -n "$pid" ]; then | ||
echo "Error: PID '${pid}' is conneted to port 8080. cannot startup new process." | ||
exit 1 | ||
fi | ||
|
||
exit 0 | ||
nohup java -jar $1 --spring.profiles.active=dev 2>&1 > out.log & | ||
echo "server started at port 8080." | ||
echo "stdout & stderr directed to 'out.log'" | ||
|