Skip to content

Commit

Permalink
Merge pull request #3239 from DFE-Digital/1937-bug-school-experience-…
Browse files Browse the repository at this point in the history
…db-backup-is-broken

[1639] Workflow minor improvements
  • Loading branch information
saliceti authored Jul 22, 2024
2 parents e6aff93 + afa24bb commit 9535156
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 104 deletions.
19 changes: 4 additions & 15 deletions .github/workflows/actions/database-backup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ runs:
echo "APP_ENVIRONMENT=$APP_ENVIRONMENT" >> $GITHUB_ENV
echo "CLUSTER=$CLUSTER" >> $GITHUB_ENV
echo "envs are: ${{ env.INF_VAULT_NAME }} ${{ env.NAMESPACE }} ${{ env.APP_ENVIRONMENT }} ${{ env.CLUSTER }}"
- uses: Azure/login@v2
with:
creds: ${{ inputs.azure_credentials }}
Expand All @@ -46,17 +44,14 @@ runs:
echo "::add-mask::$SECRET_VALUE"
echo "SLACK-WEBHOOK=$SECRET_VALUE" >> $GITHUB_OUTPUT
- name: Install kubectl
id: install-kubectl
uses: azure/setup-kubectl@v4
with:
version: "v1.26.1"
- name: Set kubectl
uses: DFE-Digital/github-actions/set-kubectl@master

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

- name: get environment variables
- name: Set environment variables
shell: bash
run: |
test_cluster_rg=s189t01-tsc-ts-rg
Expand All @@ -67,22 +62,18 @@ runs:
echo "BACKUP_FILE_NAME=$BACKUP_FILE_NAME" >> $GITHUB_ENV
case "${{ inputs.environment }}" in
development)
echo "in development"
echo "cluster_rg=$test_cluster_rg" >> $GITHUB_ENV
echo "cluster_name=$test_cluster_name" >> $GITHUB_ENV
echo "app_name=get-school-experience-development" >> $GITHUB_ENV
echo "storage_account=s189t01gsedbbkdvdsa" >> $GITHUB_ENV
;;
staging)
echo "in staging"
echo "cluster_rg=$test_cluster_rg" >> $GITHUB_ENV
echo "cluster_name=$test_cluster_name" >> $GITHUB_ENV
echo "app_name=get-school-experience-staging" >> $GITHUB_ENV
echo "storage_account=s189t01gsedbbkstgdsa" >> $GITHUB_ENV
;;
production)
echo "in production"
echo "cluster_rg=$production_cluster_rg" >> $GITHUB_ENV
echo "cluster_name=$production_cluster_name" >> $GITHUB_ENV
echo "app_name=get-school-experience-production" >> $GITHUB_ENV
Expand All @@ -93,8 +84,6 @@ runs:
;;
esac
- uses: azure/setup-kubectl@v4

- name: K8 setup
shell: bash
run: |
Expand All @@ -107,7 +96,7 @@ 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
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
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ jobs:
- name: set-up-environment
uses: DFE-Digital/github-actions/set-up-environment@master

- uses: Azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -213,10 +209,6 @@ jobs:
- name: set-up-environment
uses: DFE-Digital/github-actions/set-up-environment@master

- uses: Azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -261,10 +253,6 @@ jobs:
- name: set-up-environment
uses: DFE-Digital/github-actions/set-up-environment@master

- uses: Azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand Down
75 changes: 0 additions & 75 deletions .github/workflows/check_sp.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/db_backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Backup Database
id: db_backup
- name: Backup database
uses: ./.github/workflows/actions/database-backup
with:
environment: ${{matrix.environment}}
Expand Down

0 comments on commit 9535156

Please sign in to comment.