Skip to content

Commit

Permalink
Merge pull request #17 from VOM-Project/feature/deploy
Browse files Browse the repository at this point in the history
feat: add deploy script
  • Loading branch information
Ojimin authored Jun 1, 2024
2 parents 870a175 + 21c6abe commit 419e8c7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,3 @@ application.yml

### yml file ###
src/main/**/application-local.yml

# 배포 관련 수정
appspec.yml
23 changes: 23 additions & 0 deletions appspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: 0.0
os: linux

files:
- source: / # 인스턴스에 복사할 디렉터리 경로
destination: /home/ubuntu/app # 인스턴스에서 파일이 복사되는 위치
overwrite: yes # 복사할 위치에 파일이 있는 경우 대체

permissions:
- object: / # 권한이 지정되는 파일 or 디렉터리
pattern: "**" # 매칭되는 패턴에만 권한 부여
owner: ubuntu # object의 소유자
group: ubuntu # object의 그룹 이름

hooks:
AfterInstall: # CodeDeploy의 AfterInstall 단계에서 실행
- location: scripts/stop.sh # hooks에서 실행할 스크립트의 위치
timeout: 60 # 스크립트 실행에 허용되는 최대 시간, 넘으면 배포 실패
runas: ubuntu # 스크립트를 실행하는 사용자
ApplicationStart: # CodeDeploy의 ApplicationStart 단계에서 실행
- location: scripts/start.sh
timeout: 60
runas: ubuntu
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ configurations {
repositories {
mavenCentral()
}
//-plain.jar이 생성되지 않도록 설정
//plain.jar이 생성되지 않도록 설정
jar {
enabled = false
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/start.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

PROJECT_ROOT="/home/ubuntu/app"
JAR_FILE="$PROJECT_ROOT/VOM_Spring.jar"
JAR_FILE="$PROJECT_ROOT/VOM_Spring.jar" #일단 원하는 프로젝트 이름으로 설정

APP_LOG="$PROJECT_ROOT/application.log"
ERROR_LOG="$PROJECT_ROOT/error.log"
Expand Down

0 comments on commit 419e8c7

Please sign in to comment.