Skip to content

Commit

Permalink
Merge pull request #3082 from DFE-Digital/fix-database-backup
Browse files Browse the repository at this point in the history
Fix database backup
  • Loading branch information
RMcVelia authored Feb 28, 2024
2 parents 384a45d + 2f96a29 commit 2d75800
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
20 changes: 2 additions & 18 deletions .github/workflows/actions/database-backup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ inputs:
azure_credentials:
description: "JSON object containing a service principal that can read from Azure Key Vault"
required: true
repo_credentials:
description: "JSON object containing a service principal that can read from Azure Key Vault"
required: true


outputs:
backup_artifact:
description: "The backup artifact name"
value: ${{ inputs.environment }}-backup

runs:
using: composite
Expand Down Expand Up @@ -63,7 +54,7 @@ runs:

- uses: DFE-Digital/github-actions/set-kubelogin-environment@master
with:
azure-credentials: ${{ inputs.repo_credentials }}
azure-credentials: ${{ inputs.azure_credentials }}

- name: get environment variables
shell: bash
Expand Down Expand Up @@ -116,9 +107,9 @@ runs:
- name: Backup ${{ inputs.environment }} DB
shell: bash
run: |
bin/konduit.sh -k ${{ env.INF_VAULT_NAME }} -d gse-${{ inputs.environment }} get-school-experience-${{ inputs.environment }} -- pg_dump -E utf8 --clean --if-exists --no-owner --verbose --no-password -f ${BACKUP_FILE_NAME}.sql
tar -cvzf ${{ env.BACKUP_FILE_NAME }}.tar.gz ${{ env.BACKUP_FILE_NAME }}.sql
- name: Set Connection String
shell: bash
run: |
Expand All @@ -134,13 +125,6 @@ runs:
--account-key '${{ env.STORAGE_CONN_STR }}'
rm ${BACKUP_FILE_NAME}.tar.gz
- name: Disk cleanup
shell: bash
run: |
sudo rm -rf /usr/local/lib/android || true
sudo rm -rf /usr/share/dotnet || true
sudo rm -rf /opt/ghc || true
- name: Remove backup file
shell: bash
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/db_backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ jobs:
with:
environment: ${{matrix.environment}}
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
repo_credentials: ${{ secrets.GSE_REPO_AZ_CREDENTIALS }}

0 comments on commit 2d75800

Please sign in to comment.