From 4f915c3b257d67608b417b5a089e0f773a399812 Mon Sep 17 00:00:00 2001 From: Curry4182 Date: Wed, 20 Mar 2024 20:27:26 +0900 Subject: [PATCH] =?UTF-8?q?ci/cd:=20IS=5FBLUE=5FENV=20=EB=B3=80=EC=88=98?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CICD.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 3aa56a11..ed942a62 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -229,17 +229,24 @@ jobs: shell: bash switch-environment: - needs: [ run-docker-image-on-server-1, run-docker-image-on-server-2, set-variable-2 ] + needs: [ run-docker-image-on-server-1, run-docker-image-on-server-2] runs-on: [ self-hosted, loadbalancer-server ] if: > needs.run-docker-image-on-server-1.outputs.passed == 'true' && needs.run-docker-image-on-server-2.outputs.passed == 'true' steps: + - name: Check Blue Environment + id: check-blue + run: | + IS_BLUE_ENV=$(sh /usr/local/bin/scripts/is_blue_env.sh) + echo "::set-output name=is_blue_env::$IS_BLUE_ENV" + shell: bash + - name: Switch to Green Environment - if: ${{ needs.setup-environment.outputs.is_blue_env == 'true' }} + if: ${{ env.IS_BLUE_ENV == 'true' }} run: sh /usr/local/bin/scripts/switch_to_green_env.sh - name: Switch to Blue Environment - if: ${{ needs.setup-environment.outputs.is_blue_env != 'true' }} + if: ${{ env.IS_BLUE_ENV != 'true' }} run: sh /usr/local/bin/scripts/switch_to_blue_env.sh