Skip to content

Commit

Permalink
feat(all): ec2 서버에서 깃허브 변경 사항 반영 시 실행될 스크립트 생성
Browse files Browse the repository at this point in the history
변경 후
- appspec.yml에서 실행 순서 작성
- stop.sh) 기존 실행되던 컨테이너 삭제, 이미지 삭제
- initialize.sh) 깃허브 변경 사항 적용
- start.sh) 컨테이너 빌드 및 시작
  • Loading branch information
kaswhy committed Nov 13, 2024
1 parent 1d3dd05 commit ce0ed5a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
24 changes: 24 additions & 0 deletions appspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 0.0
os: linux

files:
- source: /
destination: /home/ubuntu/Server
overwrite: yes
file_exists_behavior: OVERWRITE
permissions:
- object: /home/ubuntu
pattern: '**'
owner: ubuntu
group: root

hooks:
ApplicationStop:
- location: scripts/stop.sh
runas: ubuntu
AfterInstall:
- location: scripts/initialize.sh
runas: ubuntu
ApplicationStart:
- location: scripts/start.sh
runas: ubuntu
1 change: 1 addition & 0 deletions scripts/initialize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
git pull
2 changes: 2 additions & 0 deletions scripts/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docker-compose build
docker-compose up -d
5 changes: 5 additions & 0 deletions scripts/stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cd /home/ubuntu/Server

docker-compose down

docker image prune -a

0 comments on commit ce0ed5a

Please sign in to comment.