-
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 #24 from UnivApp/develop
feat: cicd 구축
- Loading branch information
Showing
4 changed files
with
59 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 |
---|---|---|
|
@@ -5,6 +5,7 @@ build/ | |
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
.DB_Store | ||
|
||
### STS ### | ||
.apt_generated | ||
|
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,24 @@ | ||
version: 0.0 | ||
os: linux | ||
files: | ||
- source: build/libs/wedle-0.0.1-SNAPSHOT.jar | ||
destination: /home/ubuntu/app/step1/zip/ | ||
overwrite: yes | ||
- source: appspec.yml | ||
destination: /home/ubuntu/app/step1/zip/ | ||
overwrite: yes | ||
- source: scripts | ||
destination: /home/ubuntu/app/step1/zip/ | ||
overwrite: yes | ||
|
||
permissions: | ||
- object: / | ||
pattern: "**" | ||
owner: ubuntu | ||
group: ubuntu | ||
|
||
hooks: | ||
ApplicationStart: | ||
- location: scripts/deploy.sh | ||
timeout: 240 | ||
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,33 @@ | ||
#!/bin/bash | ||
|
||
REPOSITORY=/home/ubuntu/app/step1/zip | ||
|
||
echo "> 현재 구동 중인 애플리케이션 pid 확인" | ||
|
||
CURRENT_PID=$(pgrep -f ${REPOSITORY}.*.jar) | ||
|
||
echo "현재 구동 중인 애플리케이션 pid: $CURRENT_PID" | ||
|
||
if [ -z "$CURRENT_PID" ]; then | ||
ehco "> 현재 구동 중인 애플리케이션이 없으므로 종료하지 않습니다." | ||
else | ||
echo "> kill -15 $CURRENT_PID" | ||
kill -15 $CURRENT_PID | ||
sleep 5 | ||
fi | ||
|
||
echo "> 새 애플리케이션 배포" | ||
|
||
JAR_NAME=$(ls -tr $REPOSITORY/*.jar | tail -n 1) | ||
|
||
echo "> JAR NAME: $JAR_NAME" | ||
|
||
echo "> $JAR_NAME 에 실행권한 추가" | ||
|
||
chmod +x $JAR_NAME | ||
|
||
echo "> $JAR_NAME 실행" | ||
|
||
nohup java -jar \ | ||
-Dspring.config.location=classpath:/application.yml,classpath:application-oauth.yml \ | ||
$JAR_NAME > $REPOSITORY/nohup.out 2>&1 & |