Skip to content

Commit

Permalink
feat: Add qa-visualiser to github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
katie-gardner committed Nov 26, 2024
1 parent 823b3da commit de52841
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 217 deletions.
26 changes: 0 additions & 26 deletions .github/actions/azure-get-db-connectionstring/action.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/actions/azure-get-keyvault-secret/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Get Keyvault secret
description: Gets a secret from the Azure Keyvault

inputs:
az_keyvault_secret_name:
required: true
type: string
az_keyvault_name:
required: true
type: string

outputs:
secret_value:
description: Value of secret from the keyvault
value: ${{ steps.get-secret.outputs.secret_value }}

runs:
using: composite
steps:
- name: Get secret
id: get-secret
shell: bash
run: |
secret_value=$(az keyvault secret show --name ${{ inputs.az_keyvault_secret_name }} --vault-name ${{ inputs.az_keyvault_name }} --query value -o tsv)
echo "::add-mask::$secret_value"
echo "secret_value=$secret_value" >> $GITHUB_OUTPUT
20 changes: 10 additions & 10 deletions .github/actions/build-and-run-database-upgrader/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ inputs:
type: string
az_keyvault_name:
required: true
type: string
type: string
az_keyvault_database_connectionstring_name:
required: true
type: string
type: string
az_sql_database_server_name:
required: true
type: string
type: string
az_resource_group_name:
required: true
type: string
type: string
environment:
required: true
type: string
Expand All @@ -30,16 +30,16 @@ inputs:
runs:
using: composite
steps:
- name: Build database upgrader
- name: Build database upgrader
uses: ./.github/actions/build-dotnet-app
with:
dotnet_version: ${{ inputs.dotnet_version }}
dotnet_version: ${{ inputs.dotnet_version }}
solution_filename: Dfe.PlanTech.DatabaseUpgrader.sln

- name: Get workflow IP address
id: whats-my-ip
uses: ./.github/actions/whats-my-ip-address

- name: Add Azure firewall rules
shell: bash
run: |
Expand All @@ -48,14 +48,14 @@ runs:
- name: Get connection string
id: get-db-connection-string
uses: ./.github/actions/azure-get-db-connectionstring
uses: ./.github/actions/azure-get-keyvault-secret
with:
az_keyvault_name: ${{ inputs.az_keyvault_name }}
az_keyvault_database_connectionstring_name: ${{ inputs.az_keyvault_database_connectionstring_name }}
az_keyvault_secret_name: ${{ inputs.az_keyvault_database_connectionstring_name }}

- name: Run database upgrader
shell: bash
run: dotnet ./build/Dfe.PlanTech.DatabaseUpgrader.dll -c "${{ steps.get-db-connection-string.outputs.connection_string }}" --env ${{ inputs.environment }} -p Analytics_Username=${{ inputs.sql_analytics_username }} Analytics_Password=${{ inputs.sql_analytics_password }}
run: dotnet ./build/Dfe.PlanTech.DatabaseUpgrader.dll -c "${{ steps.get-db-connection-string.outputs.secret_value }}" --env ${{ inputs.environment }} -p Analytics_Username=${{ inputs.sql_analytics_username }} Analytics_Password=${{ inputs.sql_analytics_password }}

- name: Remove Azure firewall rules
shell: bash
Expand Down
65 changes: 0 additions & 65 deletions .github/scripts/qa-data.py

This file was deleted.

67 changes: 0 additions & 67 deletions .github/scripts/qa-visualisations.py

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/clear-user-data-from-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ jobs:

- name: Get connection string
id: get-connection-string
uses: ./.github/actions/azure-get-db-connectionstring
uses: ./.github/actions/azure-get-keyvault-secret
with:
az_keyvault_name: ${{ env.az_keyvault_name }}
az_keyvault_database_connectionstring_name: ${{ env.az_keyvault_database_connectionstring_name }}
az_keyvault_secret_name: ${{ env.az_keyvault_database_connectionstring_name }}

- name: Run clear DB SQL script
uses: azure/sql-action@v2.2
with:
connection-string: ${{ steps.get-connection-string.outputs.connection_string }}
connection-string: ${{ steps.get-connection-string.outputs.secret_value }}
path: "./.github/scripts/clear-user-data-from-db.sql"

- name: Remove Azure firewall rules
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,17 @@ jobs:
az_resource_group: ${{ env.az_resource_group_name}}
az_sql_database_server_name: ${{ env.az_sql_database_server_name }}

- name: Get Connection String
- name: Get Connection string
id: get-connection-string
uses: ./.github/actions/azure-get-db-connectionstring
uses: ./.github/actions/azure-get-keyvault-secret
with:
az_keyvault_name: ${{ env.az_keyvault_name }}
az_keyvault_database_connectionstring_name: ${{ env.az_keyvault_database_connectionstring_name }}
az_keyvault_secret_name: ${{ env.az_keyvault_database_connectionstring_name }}

- name: Execute Clear Database Stored Procedure
uses: azure/sql-action@v2.2
with:
connection-string: ${{ steps.get-connection-string.outputs.connection_string }}
connection-string: ${{ steps.get-connection-string.outputs.secret_value }}
path: "./.github/scripts/drop-establishment-data.sql"

- name: Cypress Testing
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ jobs:

- name: Get connection string
id: get-connection-string
uses: ./.github/actions/azure-get-db-connectionstring
uses: ./.github/actions/azure-get-keyvault-secret
with:
az_keyvault_name: ${{ env.az_keyvault_name }}
az_keyvault_database_connectionstring_name: ${{ env.az_keyvault_database_connectionstring_name }}
az_keyvault_secret_name: ${{ env.az_keyvault_database_connectionstring_name }}

- name: Execute stored procedure
uses: azure/sql-action@v2.2
with:
connection-string: ${{ steps.get-connection-string.outputs.connection_string }}
connection-string: ${{ steps.get-connection-string.outputs.secret_value }}
path: "./.github/scripts/drop-establishment-data.sql"

- name: Remove Azure firewall rules
Expand Down
Loading

0 comments on commit de52841

Please sign in to comment.