-
Notifications
You must be signed in to change notification settings - Fork 1
106 lines (104 loc) · 3.61 KB
/
test-failover-workflows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
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[format('OPENSHIFT_TOKEN_GOLD_{0}', github.event.inputs.project)] }}
oc-server-golddr: ${{ secrets.OPENSHIFT_SERVER_GOLDDR }}
oc-token-golddr: ${{ secrets[format('OPENSHIFT_TOKEN_GOLDDR_{0}', github.event.inputs.project)] }}
- 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