-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (66 loc) · 2.65 KB
/
deploy-staggered.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
name: Staggered Gold Deployment
on:
workflow_dispatch:
inputs:
project:
description: "The target project"
type: choice
required: true
options: ["SANDBOX", "PRODUCTION" ]
default: "SANDBOX"
environment:
description: "env to deploy"
type: choice
options: ["dev","test","prod"]
default: "dev"
jobs:
transition-scripts:
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- name: Check out the main-dr branch
uses: actions/checkout@v4
with:
ref: main-dr
- 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: Set DR to active using main-dr branch
run: |
echo "Running on the $NAMESPACE namespace"
chmod +x ./switch-to-golddr.sh
./switch-to-golddr.sh $NAMESPACE
working-directory: transition-scripts
- name: Checkout current branch
uses: actions/checkout@v4
- 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: Confirm GoldDR Endpoint is passing
run: |
echo "Confirm the GoldDR Endpoint is passing"
echo "Running on the $NAMESPACE namespace"
chmod +x ./check-endpoint-health.sh
./check-endpoint-health.sh $NAMESPACE golddr
working-directory: transition-scripts
- name: Deploy Keycloak in Gold cluster
run: |
echo "Redeploy the Keycloak app in gold cluster $NAMESPACE namespace."
chmod +x ./deploy-by-cluster.sh
./deploy-by-cluster.sh $NAMESPACE gold
working-directory: transition-scripts