-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (45 loc) · 1.69 KB
/
set-dr-to-standby.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
name: Set the DR deployment to standby
on:
workflow_dispatch:
inputs:
project:
description: "The target project"
type: choice
required: true
options: ["SANDBOX", "PRODUCTION", "OLD-SANDBOX"]
default: "SANDBOX"
environment:
description: "env to deploy"
type: choice
options: ["dev","test","prod"]
default: "dev"
deleteDRpvc:
description: "If the xlogs won't synch between patroni-dr and patroni-gold, delete the dr pvcs and config"
type: boolean
required: false
default: false
jobs:
transition-scripts:
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: Run transition script
run: |
echo "Running on the $NAMESPACE namespace"
chmod +x ./set-dr-to-standby.sh
./set-dr-to-standby.sh $NAMESPACE ${{ github.event.inputs.deleteDRpvc }}
working-directory: transition-scripts