-
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.
feat: 자동화 배포를 위한 S3 업로드 및 codeDeploy 스크립트 작성
- Loading branch information
1 parent
1dc2f0a
commit bd78291
Showing
4 changed files
with
57 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: 0.0 | ||
os: linux | ||
|
||
files: | ||
- source: / | ||
destination: /home/ubuntu/4k | ||
permissions: | ||
- object: /home/ubuntu/4k/ | ||
owner: ubuntu | ||
group: ubuntu | ||
hooks: | ||
AfterInstall: | ||
- location: scripts/deploy.sh | ||
timeout: 60 | ||
runas: ubuntu |
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,19 @@ | ||
REPOSITORY=/home/ubuntu/4k | ||
cd $REPOSITORY | ||
|
||
JAR_NAME=$(ls $REPOSITORY/build/libs/ | grep 'SNAPSHOT.jar' | tail -n 1) | ||
JAR_PATH=$REPOSITORY/build/libs/$JAR_NAME | ||
|
||
CURRENT_PID=$(pgrep -fl 'java -jar webChat-0.0.1-SNAPSHOT.jar') | ||
|
||
if [ -z $CURRENT_PID ] | ||
then | ||
echo "> 종료할 애플리케이션이 없습니다." | ||
else | ||
echo "> kill -9 $CURRENT_PID" | ||
kill -15 $CURRENT_PID | ||
sleep 5 | ||
fi | ||
|
||
echo "> Deploy - $JAR_PATH " | ||
nohup java -jar $JAR_PATH > $REPOSITORY/build/libs/nohup.out 2>&1 & |