Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preproduction database restore #2482

Closed
wants to merge 15 commits into from
Closed

Preproduction database restore #2482

wants to merge 15 commits into from

Conversation

neillturner
Copy link
Contributor

@neillturner neillturner commented Nov 1, 2024

Context

support restore and restore to point in time in preproduction for DR testing

Changes proposed in this pull request

add preprod to database_restore and database_ptr workflow

Guidance to review

Restore Point in Time

gh workflow run "Restore database from point in time to new database server" -r database-restore -f environment=preproduction -f restore-time=2024-10-29T06:00:00

see https://github.com/DFE-Digital/apply-for-qualified-teacher-status/actions/runs/11666600131

Restore from backup

gh workflow run "Restore database from Azure storage" -r database-restore -f environment=preproduction -f backup-file=afqts_pp_adhoc_2024-11-01.sql.gz

see https://github.com/DFE-Digital/apply-for-qualified-teacher-status/actions/runs/11666736478

Link to Trello card

AFQTS: database restore and ptr to preprod

Checklist

  • Attach to Trello card
  • Rebased main
  • Cleaned commit history
  • Tested by running locally

@neillturner neillturner requested a review from a team as a code owner November 1, 2024 14:52
@neillturner neillturner requested review from shaheislamdfe and removed request for a team November 1, 2024 14:53
@neillturner
Copy link
Contributor Author

@@ -45,7 +46,7 @@ jobs:
- name: Set environment variables
run: |
source global_config/${{ inputs.environment }}.sh
tf_vars_file=${{ env.TF_VARS_PATH }}/${{ inputs.environment }}/variables.tfvars.json
tf_vars_file=${{ env.TF_VARS_PATH }}/${{ env.ENVIRONMENT }}/variables.tfvars.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

${{ env.ENVIRONMENT }} is not set at this point
But $ENVIRONMENT should work

@@ -64,7 +65,7 @@ jobs:
with:
storage-account: ${{ env.STORAGE_ACCOUNT_NAME }}
resource-group: ${{ env.RESOURCE_GROUP_NAME }}
app-name: ${{ env.SERVICE_NAME }}-${{ inputs.environment }}-web
app-name: ${{ env.SERVICE_NAME }}-${{ env.ENVIRONMENT }}-web
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ENVIRONMENT is not set in GITHUB_ENV

@@ -45,7 +46,7 @@ jobs:
- name: Set environment variables
run: |
source global_config/${{ inputs.environment }}.sh
tf_vars_file=${{ env.TF_VARS_PATH }}/${{ inputs.environment }}/variables.tfvars.json
tf_vars_file=${{ env.TF_VARS_PATH }}/${{ env.ENVIRONMENT }}/variables.tfvars.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

${{ env.ENVIRONMENT }} is not set at this point
But $ENVIRONMENT should work

@neillturner neillturner closed this Nov 4, 2024
@neillturner neillturner deleted the database-restore branch November 4, 2024 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants