From ce0ed5a7c84638acc4c9056fcbf04232b80e11ff Mon Sep 17 00:00:00 2001 From: kaswhy Date: Wed, 13 Nov 2024 23:45:27 +0900 Subject: [PATCH] =?UTF-8?q?feat(all):=20ec2=20=EC=84=9C=EB=B2=84=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EA=B9=83=ED=97=88=EB=B8=8C=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?=EC=82=AC=ED=95=AD=20=EB=B0=98=EC=98=81=20=EC=8B=9C=20=EC=8B=A4?= =?UTF-8?q?=ED=96=89=EB=90=A0=20=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 변경 후 - appspec.yml에서 실행 순서 작성 - stop.sh) 기존 실행되던 컨테이너 삭제, 이미지 삭제 - initialize.sh) 깃허브 변경 사항 적용 - start.sh) 컨테이너 빌드 및 시작 --- appspec.yml | 24 ++++++++++++++++++++++++ scripts/initialize.sh | 1 + scripts/start.sh | 2 ++ scripts/stop.sh | 5 +++++ 4 files changed, 32 insertions(+) create mode 100644 appspec.yml create mode 100644 scripts/initialize.sh create mode 100644 scripts/start.sh create mode 100644 scripts/stop.sh diff --git a/appspec.yml b/appspec.yml new file mode 100644 index 0000000..3472ebf --- /dev/null +++ b/appspec.yml @@ -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 \ No newline at end of file diff --git a/scripts/initialize.sh b/scripts/initialize.sh new file mode 100644 index 0000000..bddc158 --- /dev/null +++ b/scripts/initialize.sh @@ -0,0 +1 @@ +git pull \ No newline at end of file diff --git a/scripts/start.sh b/scripts/start.sh new file mode 100644 index 0000000..cfb3d7e --- /dev/null +++ b/scripts/start.sh @@ -0,0 +1,2 @@ +docker-compose build +docker-compose up -d \ No newline at end of file diff --git a/scripts/stop.sh b/scripts/stop.sh new file mode 100644 index 0000000..a99bb2c --- /dev/null +++ b/scripts/stop.sh @@ -0,0 +1,5 @@ +cd /home/ubuntu/Server + +docker-compose down + +docker image prune -a \ No newline at end of file