-
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.
Merge pull request #28 from Tave-13th-Project-Team-4-Fiurinee/feature…
…/ci-cd chore: ci-cd 수정
- Loading branch information
Showing
2 changed files
with
56 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,21 @@ | ||
#!/bin/bash | ||
|
||
# 현재 실행 중인 JAR 프로세스를 찾고 종료합니다. | ||
CURRENT_PID=$(pgrep -f .jar) | ||
echo "$CURRENT_PID" | ||
if [ -z $CURRENT_PID ]; then | ||
echo "no process" | ||
else | ||
echo "kill $CURRENT_PID" | ||
kill -9 $CURRENT_PID | ||
sleep 3 | ||
fi | ||
|
||
# 새로운 JAR 파일의 경로를 설정하고 실행 권한을 부여합니다. | ||
JAR_PATH="/home/ec2-user/cicd/*.jar" | ||
echo "jar path : $JAR_PATH" | ||
chmod +x $JAR_PATH | ||
|
||
# 새로운 JAR 파일을 백그라운드에서 실행합니다. | ||
nohup java -jar $JAR_PATH > /dev/null 2> /dev/null < /dev/null & | ||
echo "jar file deploy success" |
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