From 6faa5705ce130aa1ee9f23f879a4e2fa5e3a9f0e Mon Sep 17 00:00:00 2001 From: Lee Euije Date: Sun, 30 Jun 2024 23:54:52 +0900 Subject: [PATCH 1/8] Update deploy-test.yml --- .github/workflows/deploy-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-test.yml b/.github/workflows/deploy-test.yml index 7ed8debc..b1ee1015 100644 --- a/.github/workflows/deploy-test.yml +++ b/.github/workflows/deploy-test.yml @@ -75,13 +75,13 @@ jobs: run: | aws s3 cp \ --region ap-northeast-2 \ - ./yello-build.zip s3://yello-test-application-bucket + ./yello-build.zip s3://yello-test-bucket - name: πŸ“‘ CodeDeploy에 배포λ₯Ό μš”μ²­ν•©λ‹ˆλ‹€. - run: aws deploy create-deployment --application-name yello-deploy-application + run: aws deploy create-deployment --application-name yello-test-deploy --deployment-config-name CodeDeployDefault.OneAtATime - --deployment-group-name yello-testing - --s3-location bucket=yello-test-application-bucket,bundleType=zip,key=yello-build.zip + --deployment-group-name yello-test-deploy + --s3-location bucket=yello-test-bucket,bundleType=zip,key=yello-build.zip - name: πŸ’‘ 배포 μƒνƒœλ₯Ό Slack을 톡해 μ „μ†‘ν•©λ‹ˆλ‹€. uses: rtCamp/action-slack-notify@v2 From aaf473df3bf1204838d0e855737ecf80c5f6cf00 Mon Sep 17 00:00:00 2001 From: Lee Euije Date: Mon, 1 Jul 2024 03:26:09 +0900 Subject: [PATCH 2/8] develop [develop] fix: ubuntu migration --- .gitignore | 2 ++ appspec.yml | 8 ++++---- scripts/deploy.sh | 30 +++++++++++++++--------------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 8ac8c49c..16f2477c 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,8 @@ application-local.yml firebase*.json *client_secret*.json +docker/docker-compose.mq.yml + ### monitoring ### monitoring/prometheus/volume monitoring/grafana diff --git a/appspec.yml b/appspec.yml index a5cc70a2..adfba752 100644 --- a/appspec.yml +++ b/appspec.yml @@ -5,15 +5,15 @@ os: linux ## μ½”λ“œ 파일 전솑 files: - source: / - destination: /home/ec2-user/app + destination: ~/app overwrite: yes # overwrite ν—ˆμš© μ—¬λΆ€ ## κΆŒν•œ μ„€μ • permissions: - object: / pattern: "**" # 전체 파일 - owner: ec2-user - group: ec2-user + owner: ubuntu + group: ubuntu # 싀행될 슀크립트 hooks: @@ -21,4 +21,4 @@ hooks: ApplicationStart: - location: deploy.sh timeout: 60 - runas: ec2-user + runas: ubuntu diff --git a/scripts/deploy.sh b/scripts/deploy.sh index ca5c88cd..0785656b 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -5,14 +5,14 @@ DOCKER_APP_NAME=yello # BLUE μ„œλ²„ 체크 EXIST_BLUE=$(sudo docker-compose -p ${DOCKER_APP_NAME}-blue -f docker-compose.blue.yml ps | grep Up) -echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] 배포λ₯Ό μ‹œμž‘ν•©λ‹ˆλ‹€." >> /home/ec2-user/deploy.log +echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] 배포λ₯Ό μ‹œμž‘ν•©λ‹ˆλ‹€." >> ~/deploy.log # Redis μ»¨ν…Œμ΄λ„ˆκ°€ μ‹€ν–‰ 쀑인지 확인 REDIS_RUNNING=$(sudo docker ps -q -f "name=redis" -f "expose=6379") # Redis μ»¨ν…Œμ΄λ„ˆκ°€ μ‹€ν–‰ 쀑이면 μΌμ‹œμ μœΌλ‘œ μ’…λ£Œ if [ -n "$REDIS_RUNNING" ]; then - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό μΌμ‹œμ μœΌλ‘œ μ’…λ£Œν•©λ‹ˆλ‹€." >> /home/ec2-user/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό μΌμ‹œμ μœΌλ‘œ μ’…λ£Œν•©λ‹ˆλ‹€." >> ~/deploy.log sudo docker-compose -p ${DOCKER_APP_NAME}-blue -f docker-compose.blue.yml stop redis sudo docker-compose -p ${DOCKER_APP_NAME}-green -f docker-compose.green.yml stop redis fi @@ -22,11 +22,11 @@ if [ -z "$EXIST_BLUE" ]; then REDIS_GREEN_RUNNING=$(sudo docker-compose -p ${DOCKER_APP_NAME}-green -f docker-compose.green.yml ps | grep redis) if [ -n "$REDIS_GREEN_RUNNING" ]; then - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Green Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> /home/ec2-user/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Green Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> ~/deploy.log sudo docker-compose -p ${DOCKER_APP_NAME}-green -f docker-compose.green.yml stop redis fi - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Blue 배포λ₯Ό μ‹œμž‘ν•©λ‹ˆλ‹€." >> /home/ec2-user/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Blue 배포λ₯Ό μ‹œμž‘ν•©λ‹ˆλ‹€." >> ~/deploy.log sudo docker-compose -p ${DOCKER_APP_NAME}-blue -f docker-compose.blue.yml up -d --build sleep 30 @@ -35,10 +35,10 @@ if [ -z "$EXIST_BLUE" ]; then if [ -z "$BLUE_HEALTH" ]; then sudo ./slack_blue.sh else - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Green μ„œλ²„λ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> /home/ec2-user/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Green μ„œλ²„λ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> ~/deploy.log sudo docker-compose -p ${DOCKER_APP_NAME}-green -f docker-compose.green.yml down sudo docker image prune -af - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Green μ„œλ²„λ₯Ό μ’…λ£Œν–ˆμŠ΅λ‹ˆλ‹€." >> /home/ec2-user/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Green μ„œλ²„λ₯Ό μ’…λ£Œν–ˆμŠ΅λ‹ˆλ‹€." >> ~/deploy.log fi # BLUEκ°€ 싀행쀑이면 GREEN up @@ -46,11 +46,11 @@ else REDIS_BLUE_RUNNING=$(sudo docker-compose -p ${DOCKER_APP_NAME}-blue -f docker-compose.blue.yml ps | grep redis) if [ -n "REDIS_BLUE_RUNNING" ]; then - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Blue Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> /home/ec2-user/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Blue Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> ~/deploy.log sudo docker-compose -p ${DOCKER_APP_NAME}-blue -f docker-compose.blue.yml stop redis fi - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Green 배포가 μ‹œμž‘λ©λ‹ˆλ‹€." >> /home/ec2-user/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Green 배포가 μ‹œμž‘λ©λ‹ˆλ‹€." >> ~/deploy.log sudo docker-compose -p ${DOCKER_APP_NAME}-green -f docker-compose.green.yml up -d --build sleep 30 @@ -59,21 +59,21 @@ else if [ -z "$GREEN_HEALTH" ]; then sudo ./slack_green.sh else - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Blue μ„œλ²„λ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> /home/ec2-user/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Blue μ„œλ²„λ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> ~/deploy.log sudo docker-compose -p ${DOCKER_APP_NAME}-blue -f docker-compose.blue.yml down sudo docker image prune -af - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Blue μ„œλ²„λ₯Ό μ’…λ£Œν–ˆμŠ΅λ‹ˆλ‹€." >> /home/ec2-user/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Blue μ„œλ²„λ₯Ό μ’…λ£Œν–ˆμŠ΅λ‹ˆλ‹€." >> ~/deploy.log fi fi # Redis μ»¨ν…Œμ΄λ„ˆκ°€ μ’…λ£Œλ˜μ—ˆμ„ 경우 λ‹€μ‹œ μ‹œμž‘ if [ -n "$REDIS_RUNNING" ]; then - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό λ‹€μ‹œ μ‹œμž‘ν•©λ‹ˆλ‹€." >> /home/ec2-user/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό λ‹€μ‹œ μ‹œμž‘ν•©λ‹ˆλ‹€." >> ~/deploy.log sudo docker-compose -p ${DOCKER_APP_NAME}-blue -f docker-compose.blue.yml start redis sudo docker image prune -af - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό λ‹€μ‹œ μ‹œμž‘ν–ˆμŠ΅λ‹ˆλ‹€." >> /home/ec2-user/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό λ‹€μ‹œ μ‹œμž‘ν–ˆμŠ΅λ‹ˆλ‹€." >> ~/deploy.log fi -echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] 배포λ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> /home/ec2-user/deploy.log -echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] 배포 ν”„λ‘œμ„ΈμŠ€ μ™„λ£Œ =====================" >> /home/ec2-user/deploy.log -echo >> /home/ec2-user/deploy.log +echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] 배포λ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> ~/deploy.log +echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] 배포 ν”„λ‘œμ„ΈμŠ€ μ™„λ£Œ =====================" >> ~/deploy.log +echo >> ~/deploy.log From 1e27ef95f5d61804efdde8c3954651886788baed Mon Sep 17 00:00:00 2001 From: Lee Euije Date: Mon, 1 Jul 2024 03:32:08 +0900 Subject: [PATCH 3/8] develop [develop] fix: file dup --- appspec.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appspec.yml b/appspec.yml index adfba752..5a9de4e9 100644 --- a/appspec.yml +++ b/appspec.yml @@ -7,6 +7,7 @@ files: - source: / destination: ~/app overwrite: yes # overwrite ν—ˆμš© μ—¬λΆ€ +file_exists_behavior: OVERWRITE ## κΆŒν•œ μ„€μ • permissions: From fb87032690f777ef7dc31a948e7cd71c1969eb1f Mon Sep 17 00:00:00 2001 From: Lee Euije Date: Mon, 1 Jul 2024 03:36:12 +0900 Subject: [PATCH 4/8] =?UTF-8?q?develop=20[develop]=20=EC=83=81=EB=8C=80?= =?UTF-8?q?=EA=B2=BD=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 0785656b..40be4e84 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -1,6 +1,6 @@ #!/bin/bash -cd /home/ec2-user/app +cd ~/app DOCKER_APP_NAME=yello # BLUE μ„œλ²„ 체크 From 4a66d00692e597b8ae759ef7918db578887b9bd1 Mon Sep 17 00:00:00 2001 From: Lee Euije Date: Mon, 1 Jul 2024 13:26:30 +0900 Subject: [PATCH 5/8] develop [develop] fix: rel -> abs --- appspec.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/appspec.yml b/appspec.yml index 5a9de4e9..ee61501d 100644 --- a/appspec.yml +++ b/appspec.yml @@ -5,9 +5,8 @@ os: linux ## μ½”λ“œ 파일 전솑 files: - source: / - destination: ~/app + destination: /home/ubuntu/app overwrite: yes # overwrite ν—ˆμš© μ—¬λΆ€ -file_exists_behavior: OVERWRITE ## κΆŒν•œ μ„€μ • permissions: From 01293f731a038edd0fd59e5b7c500954bc087d3a Mon Sep 17 00:00:00 2001 From: Lee Euije Date: Mon, 1 Jul 2024 14:00:36 +0900 Subject: [PATCH 6/8] develop [develop] fix: rel -> abs --- scripts/deploy.sh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 40be4e84..1d2d9bae 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -1,18 +1,18 @@ #!/bin/bash -cd ~/app +cd /home/ubuntu/app DOCKER_APP_NAME=yello # BLUE μ„œλ²„ 체크 EXIST_BLUE=$(sudo docker-compose -p ${DOCKER_APP_NAME}-blue -f docker-compose.blue.yml ps | grep Up) -echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] 배포λ₯Ό μ‹œμž‘ν•©λ‹ˆλ‹€." >> ~/deploy.log +echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] 배포λ₯Ό μ‹œμž‘ν•©λ‹ˆλ‹€." >> /home/ubuntu/deploy.log # Redis μ»¨ν…Œμ΄λ„ˆκ°€ μ‹€ν–‰ 쀑인지 확인 REDIS_RUNNING=$(sudo docker ps -q -f "name=redis" -f "expose=6379") # Redis μ»¨ν…Œμ΄λ„ˆκ°€ μ‹€ν–‰ 쀑이면 μΌμ‹œμ μœΌλ‘œ μ’…λ£Œ if [ -n "$REDIS_RUNNING" ]; then - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό μΌμ‹œμ μœΌλ‘œ μ’…λ£Œν•©λ‹ˆλ‹€." >> ~/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό μΌμ‹œμ μœΌλ‘œ μ’…λ£Œν•©λ‹ˆλ‹€." >> /home/ubuntu/deploy.log sudo docker-compose -p ${DOCKER_APP_NAME}-blue -f docker-compose.blue.yml stop redis sudo docker-compose -p ${DOCKER_APP_NAME}-green -f docker-compose.green.yml stop redis fi @@ -22,11 +22,11 @@ if [ -z "$EXIST_BLUE" ]; then REDIS_GREEN_RUNNING=$(sudo docker-compose -p ${DOCKER_APP_NAME}-green -f docker-compose.green.yml ps | grep redis) if [ -n "$REDIS_GREEN_RUNNING" ]; then - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Green Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> ~/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Green Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> /home/ubuntu/deploy.log sudo docker-compose -p ${DOCKER_APP_NAME}-green -f docker-compose.green.yml stop redis fi - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Blue 배포λ₯Ό μ‹œμž‘ν•©λ‹ˆλ‹€." >> ~/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Blue 배포λ₯Ό μ‹œμž‘ν•©λ‹ˆλ‹€." >> /home/ubuntu/deploy.log sudo docker-compose -p ${DOCKER_APP_NAME}-blue -f docker-compose.blue.yml up -d --build sleep 30 @@ -35,10 +35,10 @@ if [ -z "$EXIST_BLUE" ]; then if [ -z "$BLUE_HEALTH" ]; then sudo ./slack_blue.sh else - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Green μ„œλ²„λ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> ~/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Green μ„œλ²„λ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> /home/ubuntu/deploy.log sudo docker-compose -p ${DOCKER_APP_NAME}-green -f docker-compose.green.yml down sudo docker image prune -af - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Green μ„œλ²„λ₯Ό μ’…λ£Œν–ˆμŠ΅λ‹ˆλ‹€." >> ~/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Green μ„œλ²„λ₯Ό μ’…λ£Œν–ˆμŠ΅λ‹ˆλ‹€." >> /home/ubuntu/deploy.log fi # BLUEκ°€ 싀행쀑이면 GREEN up @@ -46,11 +46,11 @@ else REDIS_BLUE_RUNNING=$(sudo docker-compose -p ${DOCKER_APP_NAME}-blue -f docker-compose.blue.yml ps | grep redis) if [ -n "REDIS_BLUE_RUNNING" ]; then - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Blue Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> ~/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Blue Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> /home/ubuntu/deploy.log sudo docker-compose -p ${DOCKER_APP_NAME}-blue -f docker-compose.blue.yml stop redis fi - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Green 배포가 μ‹œμž‘λ©λ‹ˆλ‹€." >> ~/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Green 배포가 μ‹œμž‘λ©λ‹ˆλ‹€." >> /home/ubuntu/deploy.log sudo docker-compose -p ${DOCKER_APP_NAME}-green -f docker-compose.green.yml up -d --build sleep 30 @@ -59,21 +59,21 @@ else if [ -z "$GREEN_HEALTH" ]; then sudo ./slack_green.sh else - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Blue μ„œλ²„λ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> ~/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Blue μ„œλ²„λ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> /home/ubuntu/deploy.log sudo docker-compose -p ${DOCKER_APP_NAME}-blue -f docker-compose.blue.yml down sudo docker image prune -af - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Blue μ„œλ²„λ₯Ό μ’…λ£Œν–ˆμŠ΅λ‹ˆλ‹€." >> ~/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Blue μ„œλ²„λ₯Ό μ’…λ£Œν–ˆμŠ΅λ‹ˆλ‹€." >> /home/ubuntu/deploy.log fi fi # Redis μ»¨ν…Œμ΄λ„ˆκ°€ μ’…λ£Œλ˜μ—ˆμ„ 경우 λ‹€μ‹œ μ‹œμž‘ if [ -n "$REDIS_RUNNING" ]; then - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό λ‹€μ‹œ μ‹œμž‘ν•©λ‹ˆλ‹€." >> ~/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό λ‹€μ‹œ μ‹œμž‘ν•©λ‹ˆλ‹€." >> /home/ubuntu/deploy.log sudo docker-compose -p ${DOCKER_APP_NAME}-blue -f docker-compose.blue.yml start redis sudo docker image prune -af - echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό λ‹€μ‹œ μ‹œμž‘ν–ˆμŠ΅λ‹ˆλ‹€." >> ~/deploy.log + echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] Redis μ»¨ν…Œμ΄λ„ˆλ₯Ό λ‹€μ‹œ μ‹œμž‘ν–ˆμŠ΅λ‹ˆλ‹€." >> /home/ubuntu/deploy.log fi -echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] 배포λ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> ~/deploy.log -echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] 배포 ν”„λ‘œμ„ΈμŠ€ μ™„λ£Œ =====================" >> ~/deploy.log -echo >> ~/deploy.log +echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] 배포λ₯Ό μ’…λ£Œν•©λ‹ˆλ‹€." >> /home/ubuntu/deploy.log +echo "[$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S)] 배포 ν”„λ‘œμ„ΈμŠ€ μ™„λ£Œ =====================" >> /home/ubuntu/deploy.log +echo >> /home/ubuntu/deploy.log From 7405cfbbb0791594e4fc56a22c1f5b4ffbf91a1e Mon Sep 17 00:00:00 2001 From: Lee Euije Date: Mon, 1 Jul 2024 17:33:18 +0900 Subject: [PATCH 7/8] =?UTF-8?q?develop=20[develop]=20fix:=20redis=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/docker-compose.blue.yml | 6 ------ docker/docker-compose.green.yml | 6 ------ 2 files changed, 12 deletions(-) diff --git a/docker/docker-compose.blue.yml b/docker/docker-compose.blue.yml index c15aea13..4cf02b62 100644 --- a/docker/docker-compose.blue.yml +++ b/docker/docker-compose.blue.yml @@ -1,10 +1,6 @@ #blue version: '3' services: - redis: - image: redis - ports: - - "6379:6379" backend: build: . ports: @@ -12,5 +8,3 @@ services: container_name: yello-blue environment: - TZ=Asia/Seoul - depends_on: - - redis diff --git a/docker/docker-compose.green.yml b/docker/docker-compose.green.yml index 153237cf..21689730 100644 --- a/docker/docker-compose.green.yml +++ b/docker/docker-compose.green.yml @@ -1,10 +1,6 @@ #blue version: '3' services: - redis: - image: redis - ports: - - "6379:6379" backend: build: . ports: @@ -12,5 +8,3 @@ services: container_name: yello-green environment: - TZ=Asia/Seoul - depends_on: - - redis From ea3f24b52961e2792e0cd63b84458b24102c0aab Mon Sep 17 00:00:00 2001 From: Lee Euije Date: Tue, 2 Jul 2024 01:46:07 +0900 Subject: [PATCH 8/8] =?UTF-8?q?develop=20[develop]=20fix:=20=EB=A9=94?= =?UTF-8?q?=EC=9D=B8=EC=84=9C=EB=B2=84=20aws=20migration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 8 ++++---- .gitignore | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 61af885c..079853d7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -76,13 +76,13 @@ jobs: run: | aws s3 cp \ --region ap-northeast-2 \ - ./yello-build.zip s3://yello-server-bucket + ./yello-build.zip s3://yello-bucket - name: πŸ“‘ CodeDeploy에 배포λ₯Ό μš”μ²­ν•©λ‹ˆλ‹€. - run: aws deploy create-deployment --application-name yello-server-deploy + run: aws deploy create-deployment --application-name yello-deploy --deployment-config-name CodeDeployDefault.OneAtATime - --deployment-group-name yello-app - --s3-location bucket=yello-server-bucket,bundleType=zip,key=yello-build.zip + --deployment-group-name yello-deploy + --s3-location bucket=yello-bucket,bundleType=zip,key=yello-build.zip - name: πŸ’‘ 배포 μƒνƒœλ₯Ό Slack을 톡해 μ „μ†‘ν•©λ‹ˆλ‹€. uses: rtCamp/action-slack-notify@v2 diff --git a/.gitignore b/.gitignore index 16f2477c..e624bf03 100644 --- a/.gitignore +++ b/.gitignore @@ -45,7 +45,7 @@ application-local.yml firebase*.json *client_secret*.json -docker/docker-compose.mq.yml +docker/rabbitmq/** ### monitoring ### monitoring/prometheus/volume