Skip to content

Commit

Permalink
Roll backup into standard deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts committed Oct 2, 2024
1 parent a1fb7e4 commit 744a27a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 deletions.
27 changes: 7 additions & 20 deletions .github/workflows/.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,6 @@ jobs:
${{ github.event_name == 'pull_request' && '-p MEMORY_REQUEST=100Mi' || '' }}
${{ github.event_name == 'pull_request' && '-p MEMORY_LIMIT=200Mi' || '' }}

- name: Deploy Database Backup
if: steps.triggers.outputs.core == 'true' || steps.triggers.outputs.sync == 'true'
env:
CRONJOB: ${{ github.event.repository.name }}-${{ inputs.target }}-database-backup
uses: bcgov-nr/[email protected]
with:
file: common/openshift.backup.yml
oc_namespace: ${{ vars.OC_NAMESPACE }}
oc_server: ${{ secrets.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
oc_version: "4.13"
overwrite: true
parameters: -p ZONE=${{ env.ZONE }} -p PG_DB_IMAGE=postgis/postgis:15-master
post_rollout: oc create job --from=cronjob/${{ env.CRONJOB }} ${{ env.CRONJOB }}-$(date +%Y%m%d%H%M%S)

deploy:
name: Deploy
environment: ${{ inputs.environment }}
Expand All @@ -129,24 +114,26 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
name: [backend, frontend, oracle-api]
name: [backend, backup, frontend, oracle-api]
include:
- name: backend
file: backend/openshift.deploy.yml
overwrite: true
parameters:
-p AWS_COGNITO_ISSUER_URI=https://cognito-idp.ca-central-1.amazonaws.com/${{ vars.VITE_USER_POOLS_ID }}
verification_path: "health"
- name: backup
file: common/openshift.backup.yml
parameters:
-p ZONE=${{ env.ZONE }} -p PG_DB_IMAGE=postgis/postgis:15-master
post_rollout: oc create job --from=cronjob/${{ env.CRONJOB }} ${{ env.CRONJOB }}-$(date +%Y%m%d%H%M%S)
- name: frontend
file: frontend/openshift.deploy.yml
overwrite: true
parameters:
-p FAM_MODDED_ZONE=${{ needs.init.outputs.fam-modded-zone }}
-p VITE_SPAR_BUILD_VERSION=snapshot-${{ inputs.target || github.event.number }}
-p VITE_USER_POOLS_ID=${{ vars.VITE_USER_POOLS_ID }}
- name: oracle-api
file: oracle-api/openshift.deploy.yml
overwrite: true
parameters:
-p AWS_COGNITO_ISSUER_URI=https://cognito-idp.ca-central-1.amazonaws.com/${{ vars.VITE_USER_POOLS_ID }}
${{ github.event_name == 'pull_request' && '-p CPU_LIMIT=100m' || '' }}
Expand All @@ -162,7 +149,7 @@ jobs:
oc_namespace: ${{ vars.OC_NAMESPACE }}
oc_server: ${{ vars.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: ${{ matrix.overwrite }}
overwrite: true
parameters:
-p TAG=${{ inputs.tag }}
-p ZONE=${{ inputs.target }}
Expand Down
6 changes: 6 additions & 0 deletions common/openshift.backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ parameters:
- name: PG_DB_IMAGE
description: PostgreSQL Image (namespace/name:tag) to be used for backup
required: true
- name: TAG
description: Dummy param, for convenience
- name: MIN_REPLICAS
description: Dummy param, for convenience
- name: MAX_REPLICAS
description: Dummy param, for convenience
objects:
- kind: PersistentVolumeClaim
apiVersion: v1
Expand Down

0 comments on commit 744a27a

Please sign in to comment.