Skip to content

Commit

Permalink
Cleanup Host Databases (#1875)
Browse files Browse the repository at this point in the history
* new gh action step to delete old host dbs
  • Loading branch information
badgersrus authored Apr 12, 2024
1 parent 860b34d commit 7e50d21
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/manual-deploy-testnet-l2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,17 @@ jobs:
inlineScript: |
$(az resource list --tag ${{ vars.AZURE_DEPLOY_GROUP_L2 }}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true
# Delete old database tables from previous deployment
- name: 'Delete host databases'
uses: azure/CLI@v1
with:
inlineScript: |
databases=$(az postgres flexible-server db list --resource-group Testnet --server-name postgres-ten-${{ github.event.inputs.testnet_type }} --query "[?starts_with(name, 'host_')].[name]" -o tsv)
for db in $databases; do
az postgres flexible-server db delete --database-name "$db" --resource-group Testnet --server-name postgres-ten-${{ github.event.inputs.testnet_type }} --yes
done
- name: 'Upload L1 deployer container logs'
uses: actions/upload-artifact@v3
with:
Expand Down

0 comments on commit 7e50d21

Please sign in to comment.