Skip to content

Commit

Permalink
chore(ci): cronjob image and simplify deploy trigger (#735)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts authored Jan 6, 2025
1 parent ee39b11 commit 37a11c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,17 @@ jobs:
-p DB_TESTDATA=true
-p AWS_USER_POOLS_WEB_CLIENT_ID="7hpo4qa7j0hs0rkfl2pm0sto5k"
-p LOGOUT_CHAIN_URL="https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi?retnow=1&returl=https://dev.loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/logout?redirect_uri="
triggers: ('db/' 'libs/' 'api/')
- name: admin
file: admin/openshift.deploy.yml
overwrite: true
parameters: -p REPLICA_COUNT=1
triggers: ('db/' 'libs/' 'api/' 'admin/')
- name: db
file: db/openshift.deploy.yml
overwrite: false
triggers: ('db/' 'libs/' 'api/' 'admin/' 'public/')
- name: public
file: public/openshift.deploy.yml
overwrite: true
parameters: -p REPLICA_COUNT=1
triggers: ('db/' 'libs/' 'api/' 'public/')
steps:
- uses: bcgov-nr/[email protected]
with:
Expand All @@ -115,4 +111,4 @@ jobs:
-p URL=fom-${{ needs.init.outputs.route_number }}.apps.silver.devops.gov.bc.ca
-p ZONE=${{ github.event.number }} -p TAG=${{ github.event.number }}
${{ matrix.parameters }}
triggers: ${{ matrix.triggers }}
triggers: ('db/' 'libs/' 'api/' 'admin/' 'public/')
7 changes: 5 additions & 2 deletions db/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ parameters:
- name: TAG
description: Image tag; e.g. PR number, latest or prod
required: true
- name: CRONJOB_RESTORE_TAG
description: Image tag for database restore cronjob; e.g. PR number, latest or prod
value: prod
- description: Volume space available for data, e.g. 512Mi, 2Gi.
displayName: Database Volume Capacity
name: DB_PVC_SIZE
Expand Down Expand Up @@ -339,7 +342,7 @@ objects:
containers:
- name: ${NAME}-${ZONE}-${COMPONENT}-restore
# use the same image as our database, so we can run the psql command
image: ${REGISTRY}/${ORG}/nr-fom/${COMPONENT}:${ZONE}
image: ${REGISTRY}/${ORG}/nr-fom/${COMPONENT}:${CRONJOB_RESTORE_TAG}
command: ["/bin/sh", "-c"]
args:
- |
Expand Down Expand Up @@ -384,7 +387,7 @@ objects:
echo "psql successfully reverted current failed db restore procedure. DB fom is back to original state. However, the restore procedure failed."
exit $db_restore_cmd_status
else
echo "Error: psql failed to attmpt reverting failed db restore procedure. Please manually rename ${OLD_FOM_DATABASE_NAME} back to fom."
echo "Error: psql failed to attempt reverting failed db restore procedure. Please manually rename ${OLD_FOM_DATABASE_NAME} back to fom."
exit $db_revert_restore_cmd_status
fi
else
Expand Down

0 comments on commit 37a11c4

Please sign in to comment.