chore: deploy uptime incident to production switchover #46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test - Disaster Recovery Integration Test | |
on: | |
workflow_dispatch: | |
inputs: | |
project: | |
description: "The target project" | |
type: choice | |
required: true | |
options: ["SANDBOX"] | |
default: "SANDBOX" | |
environment: | |
description: "env to deploy" | |
type: choice | |
options: ["dev"] | |
default: "dev" | |
push: | |
branches: | |
- main | |
paths: | |
- 'src/**' | |
- 'helm/**' | |
- '.github/workflows/publish-image.yml' | |
- 'Dockerfile' | |
- 'poetry.lock' | |
- 'pyproject.toml' | |
inputs: | |
project: | |
description: "The target project" | |
required: true | |
default: "SANDBOX" | |
environment: | |
description: "env to deploy" | |
required: true | |
default: "dev" | |
jobs: | |
failover-failback-test: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set the deployment namespace | |
run: | | |
chmod +x ./namespace-setter.sh | |
./namespace-setter.sh ${{ github.event.inputs.project }} ${{ github.event.inputs.environment }} | |
working-directory: .github/helpers | |
- name: Login Openshift Gold & Golddr | |
uses: ./.github/actions/oc-login | |
with: | |
namespace: $NAMESPACE | |
oc-server-gold: ${{ secrets.OPENSHIFT_SERVER_GOLD }} | |
oc-token-gold: ${{ secrets.OPENSHIFT_TOKEN_GOLD }} | |
oc-server-golddr: ${{ secrets.OPENSHIFT_SERVER_GOLDDR }} | |
oc-token-golddr: ${{ secrets.OPENSHIFT_TOKEN_GOLDDR }} | |
- name: Install test dependencies | |
run: | | |
sudo apt update | |
sudo apt-get update | |
sudo apt-get -y install syslinux-utils | |
- name: Redeploy Gold and GoldDR keycloak | |
run: | | |
echo "Running on the $NAMESPACE namespace" | |
chmod +x ./deploy.sh | |
./deploy.sh $NAMESPACE | |
working-directory: transition-scripts | |
- name: Confirm DNS pointing to Gold | |
run: | | |
chmod +x ./test-dns.sh | |
./test-dns.sh dev.sandbox.loginproxy.gov.bc.ca gold | |
working-directory: transition-scripts/test-helpers | |
- name: Disable Gold Route | |
run: | | |
chmod +x ./enable-disable-gold-route.sh | |
./enable-disable-gold-route.sh $NAMESPACE disable | |
working-directory: transition-scripts | |
- name: Confirm DNS pointing to GoldDR | |
run: | | |
chmod +x ./test-dns.sh | |
./test-dns.sh dev.sandbox.loginproxy.gov.bc.ca golddr | |
working-directory: transition-scripts/test-helpers | |
- name: Wait for keycloak dr pods to be up | |
run: | | |
chmod +x ./wait-keycloak-dr-ready.sh | |
./wait-keycloak-dr-ready.sh $NAMESPACE | |
working-directory: transition-scripts/test-helpers | |
- name: Confirm DNS still pointing to GoldDR | |
run: | | |
chmod +x ./test-dns.sh | |
./test-dns.sh dev.sandbox.loginproxy.gov.bc.ca golddr | |
working-directory: transition-scripts/test-helpers | |
- name: Enable Gold Route | |
run: | | |
chmod +x ./enable-disable-gold-route.sh | |
./enable-disable-gold-route.sh $NAMESPACE enable | |
working-directory: transition-scripts | |
- name: Confirm DNS pointing to Gold | |
run: | | |
chmod +x ./test-dns.sh | |
./test-dns.sh dev.sandbox.loginproxy.gov.bc.ca gold | |
working-directory: transition-scripts/test-helpers | |
- name: Set DR to Standby | |
run: | | |
chmod +x ./set-dr-to-standby.sh | |
./set-dr-to-standby.sh $NAMESPACE false | |
working-directory: transition-scripts |