-
Notifications
You must be signed in to change notification settings - Fork 2
89 lines (79 loc) · 3.92 KB
/
Copy pathcrunchy.yaml
File metadata and controls
89 lines (79 loc) · 3.92 KB
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
name: Crunchy - Deploy Updated Crunchy Helm Chart to OpenShift
run-name: Deploy Crunchy Helm Chart to OpenShift ${{ github.event.inputs.cluster }} for ${{ github.event.inputs.environment }}
on:
workflow_dispatch:
inputs:
environment:
type: environment
cluster:
type: choice
description: OpenShift Cluster
options:
- gold
- golddr
- both
permissions:
contents: read
env:
HELM_CHART_NAME: ${{ github.event.inputs.environment }}-drivebc-db
jobs:
deploy-gold:
if: ${{ github.event.inputs.cluster == 'gold' || github.event.inputs.cluster == 'both' }}
runs-on: ubuntu-latest
name: Deploy to Gold (${{ github.event.inputs.environment }})
environment:
name: ${{ github.event.inputs.environment }}
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: OC Setup
uses: ./.github/actions/oc-setup
with:
server: ${{ vars.OPENSHIFT_GOLD_SERVER }}
token: ${{ secrets.OPENSHIFT_GOLD_TOKEN }}
namespace: ${{ vars.OPENSHIFT_NAMESPACE }}
# In github secrets the bucket for pgbackrest is just the bucket name, for backup-storage it's the bucket/path because the
# backup container needs the exact path to save the files. Note that you need to create the folder in S3 for the backup storage
# bucket before running this workflow, otherwise the backup will fail because it can't create the folder itself as of the time of writing this.
- name: Helm upgrade on Gold
run: |
helm dep update ./infrastructure/crunchy-postgres
helm upgrade ${{ env.HELM_CHART_NAME }} \
-f ./infrastructure/crunchy-postgres/values-${{ github.event.inputs.environment }}.yaml \
./infrastructure/crunchy-postgres \
--set crunchy.pgBackRest.s3.bucket=${{ secrets.CRUNCHY_S3_BUCKET }} \
--set crunchy.pgBackRest.s3.endpoint=${{ secrets.CRUNCHY_S3_ENDPOINT }} \
--set backup-storage.env.S3_BUCKET.value=${{ secrets.CRUNCHY_S3_BACKUP_STORAGE_BUCKET }} \
--set backup-storage.env.S3_ENDPOINT.value=${{ secrets.CRUNCHY_S3_ENDPOINT }} \
--set backup-storage.env.S3_USER.value=${{ secrets.CRUNCHY_S3_ACCESS_KEY }} \
--set backup-storage.env.S3_PASSWORD.value=${{ secrets.CRUNCHY_S3_SECRET_KEY }} \
--set backup-storage.env.WEBHOOK_URL.value=${{ secrets.CRUNCHY_WEBHOOK_URL }}
deploy-golddr:
if: ${{ github.event.inputs.cluster == 'golddr' || github.event.inputs.cluster == 'both' }}
runs-on: ubuntu-latest
name: Deploy to GoldDR (${{ github.event.inputs.environment }})
environment:
name: ${{ github.event.inputs.environment }}
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: OC Setup
uses: ./.github/actions/oc-setup
with:
server: ${{ vars.OPENSHIFT_GOLDDR_SERVER }}
token: ${{ secrets.OPENSHIFT_GOLDDR_TOKEN }}
namespace: ${{ vars.OPENSHIFT_NAMESPACE }}
- name: Helm upgrade on GoldDR
run: |
helm dep update ./infrastructure/crunchy-postgres
helm upgrade ${{ env.HELM_CHART_NAME }} \
-f ./infrastructure/crunchy-postgres/values-${{ github.event.inputs.environment }}.yaml \
-f ./infrastructure/crunchy-postgres/values-${{ github.event.inputs.environment }}-dr.yaml \
./infrastructure/crunchy-postgres \
--set crunchy.pgBackRest.s3.bucket=${{ secrets.CRUNCHY_S3_BUCKET }} \
--set crunchy.pgBackRest.s3.endpoint=${{ secrets.CRUNCHY_S3_ENDPOINT }} \
--set backup-storage.env.S3_BUCKET.value=${{ secrets.CRUNCHY_S3_BACKUP_STORAGE_BUCKET }} \
--set backup-storage.env.S3_ENDPOINT.value=${{ secrets.CRUNCHY_S3_ENDPOINT }} \
--set backup-storage.env.S3_USER.value=${{ secrets.CRUNCHY_S3_ACCESS_KEY }} \
--set backup-storage.env.S3_PASSWORD.value=${{ secrets.CRUNCHY_S3_SECRET_KEY }} \
--set backup-storage.env.WEBHOOK_URL.value=${{ secrets.CRUNCHY_WEBHOOK_URL }}