Skip to content

Commit

Permalink
ci/cd: IS_BLUE_ENV 변수 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Curry4182 committed Mar 20, 2024
1 parent 94bd4ba commit 4f915c3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4f915c3

Please sign in to comment.