From 16ac17c774474afe6510aa95398c5fff834e4fa5 Mon Sep 17 00:00:00 2001 From: jun02160 Date: Sat, 21 Dec 2024 22:06:49 +0900 Subject: [PATCH 1/7] chore: update directory name --- .github/workflows/cd-to-dev.yml | 8 ++++---- scripts/deploy.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cd-to-dev.yml b/.github/workflows/cd-to-dev.yml index df29c264..c77d1ed0 100644 --- a/.github/workflows/cd-to-dev.yml +++ b/.github/workflows/cd-to-dev.yml @@ -85,7 +85,7 @@ jobs: username: ${{ secrets.RELEASE_SERVER_USER }} key: ${{ secrets.DEV_RELEASE_SERVER_KEY }} source: "./docker-compose.yml" - target: "/home/ec2-user/app/" + target: "/home/ec2-user/playground/" - name: 'Send deploy script to EC2 Instance' uses: appleboy/scp-action@master @@ -94,7 +94,7 @@ jobs: username: ${{ secrets.RELEASE_SERVER_USER }} key: ${{ secrets.DEV_RELEASE_SERVER_KEY }} source: "./scripts/" - target: "/home/ec2-user/app/" + target: "/home/ec2-user/playground/" - name: 'Get current time' uses: 1466587594/get-current-time@v2 @@ -113,6 +113,6 @@ jobs: script: | cd ~ sudo docker pull $ECR_REPO - sudo chmod +x ./app/scripts/*.sh - ./app/scripts/deploy.sh + sudo chmod +x ./playground/scripts/*.sh + ./playground/scripts/deploy.sh docker image prune -f diff --git a/scripts/deploy.sh b/scripts/deploy.sh index e131cacd..160ba21f 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -2,10 +2,10 @@ cd /home/ec2-user/app # Source the external scripts to load their functions -source /home/ec2-user/app/scripts/health_check.sh -source /home/ec2-user/app/scripts/deploy_container.sh -source /home/ec2-user/app/scripts/nginx_reload.sh -source /home/ec2-user/app/scripts/stop_container.sh +source /home/ec2-user/playground/scripts/health_check.sh +source /home/ec2-user/playground/scripts/deploy_container.sh +source /home/ec2-user/playground/scripts/nginx_reload.sh +source /home/ec2-user/playground/scripts/stop_container.sh ALL_PORTS=("8080","8081") From acbf5b49a921e10c120c345f913cb6f865e2471d Mon Sep 17 00:00:00 2001 From: jun02160 Date: Sat, 21 Dec 2024 22:13:53 +0900 Subject: [PATCH 2/7] chore: update env name --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f4f3f377..7f7ab734 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.8' services: playground-blue: - image: ${ECR_REPO} + image: ${PLAYGROUND_ECR_REPO} expose: - 8080 ports: @@ -11,7 +11,7 @@ services: - SPRING_PROFILES_ACTIVE=${SPRING_PROFILES_ACTIVE} playground-green: - image: ${ECR_REPO} + image: ${PLAYGROUND_ECR_REPO} expose: - 8080 ports: From 4907ca9d3a17f0d9bb3ba23e6226d65f0416c087 Mon Sep 17 00:00:00 2001 From: jun02160 Date: Sat, 21 Dec 2024 22:22:19 +0900 Subject: [PATCH 3/7] chore: update prod script --- .github/workflows/cd-to-prod.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd-to-prod.yml b/.github/workflows/cd-to-prod.yml index 12f8704f..fd3aa97b 100644 --- a/.github/workflows/cd-to-prod.yml +++ b/.github/workflows/cd-to-prod.yml @@ -84,7 +84,7 @@ jobs: username: ${{ secrets.RELEASE_SERVER_USER }} key: ${{ secrets.PROD_RELEASE_SERVER_KEY }} source: "./docker-compose.yml" - target: "/home/ec2-user/app/" + target: "/home/ec2-user/playground/" - name: 'Send deploy script to EC2 Instance' uses: appleboy/scp-action@master @@ -93,7 +93,7 @@ jobs: username: ${{ secrets.RELEASE_SERVER_USER }} key: ${{ secrets.PROD_RELEASE_SERVER_KEY }} source: "./scripts/" - target: "/home/ec2-user/app/" + target: "/home/ec2-user/playground/" - name: 'Get current time' uses: 1466587594/get-current-time@v2 @@ -112,6 +112,6 @@ jobs: script: | cd ~ sudo docker pull $ECR_REPO - sudo chmod +x ./app/scripts/*.sh - ./app/scripts/deploy.sh + sudo chmod +x ./playground/scripts/*.sh + ./playground/scripts/deploy.sh docker image prune -f From a8c0a66b3169ef7588020b9adaf6f3cf05fdebe7 Mon Sep 17 00:00:00 2001 From: jun02160 Date: Sat, 21 Dec 2024 22:23:53 +0900 Subject: [PATCH 4/7] =?UTF-8?q?chore:=20service-url.inc=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EB=AA=85=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/nginx_reload.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/nginx_reload.sh b/scripts/nginx_reload.sh index 03bcf196..91bccb3d 100644 --- a/scripts/nginx_reload.sh +++ b/scripts/nginx_reload.sh @@ -6,7 +6,7 @@ reload_nginx() { echo "▶️ Nginx Reload (Port switching applied) ..." - echo "set \$service_url http://127.0.0.1:${PORT};" | sudo tee /etc/nginx/conf.d/service-url.inc + echo "set \$service_url http://127.0.0.1:${PORT};" | sudo tee /etc/nginx/conf.d/playground-url.inc sudo nginx -s reload - echo "Current running Port after switching: $(sudo cat /etc/nginx/conf.d/service-url.inc)" + echo "Current running Port after switching: $(sudo cat /etc/nginx/conf.d/playground-url.inc)" } From 057f79cf48bfe3899c0b43dd415a2a659afb2a9c Mon Sep 17 00:00:00 2001 From: jun02160 Date: Sat, 21 Dec 2024 22:32:27 +0900 Subject: [PATCH 5/7] chore: trigger setting for test --- .github/workflows/cd-to-dev.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/cd-to-dev.yml b/.github/workflows/cd-to-dev.yml index c77d1ed0..b080f54c 100644 --- a/.github/workflows/cd-to-dev.yml +++ b/.github/workflows/cd-to-dev.yml @@ -16,6 +16,9 @@ on: types: [deploy-to-test-event] push: branches: [ develop ] + pull_request: + types: + - edited env: SPRING_PROFILES_ACTIVE: dev From 7902e1efdade2539b134cdbfe94577901fe0cb04 Mon Sep 17 00:00:00 2001 From: jun02160 Date: Wed, 1 Jan 2025 22:19:23 +0900 Subject: [PATCH 6/7] test: prod deploy --- .github/workflows/cd-to-dev.yml | 3 --- .github/workflows/cd-to-prod.yml | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd-to-dev.yml b/.github/workflows/cd-to-dev.yml index b080f54c..c77d1ed0 100644 --- a/.github/workflows/cd-to-dev.yml +++ b/.github/workflows/cd-to-dev.yml @@ -16,9 +16,6 @@ on: types: [deploy-to-test-event] push: branches: [ develop ] - pull_request: - types: - - edited env: SPRING_PROFILES_ACTIVE: dev diff --git a/.github/workflows/cd-to-prod.yml b/.github/workflows/cd-to-prod.yml index fd3aa97b..71abf8d3 100644 --- a/.github/workflows/cd-to-prod.yml +++ b/.github/workflows/cd-to-prod.yml @@ -16,6 +16,9 @@ on: types: [deploy-to-prod-event] push: branches: [ main ] + pull_request: + types: + - edited env: SPRING_PROFILES_ACTIVE: prod From 8d8af3f6aef57a8ae39f15588147576890a07808 Mon Sep 17 00:00:00 2001 From: jun02160 Date: Wed, 1 Jan 2025 22:26:11 +0900 Subject: [PATCH 7/7] =?UTF-8?q?chore:=20test=EC=9A=A9=20trigger=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 --- .github/workflows/cd-to-prod.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/cd-to-prod.yml b/.github/workflows/cd-to-prod.yml index 71abf8d3..fd3aa97b 100644 --- a/.github/workflows/cd-to-prod.yml +++ b/.github/workflows/cd-to-prod.yml @@ -16,9 +16,6 @@ on: types: [deploy-to-prod-event] push: branches: [ main ] - pull_request: - types: - - edited env: SPRING_PROFILES_ACTIVE: prod