Execute Aurora DB cleanup in a separate workflow to prevent timeout on cancel (#29689)
Closes keycloak/keycloak-benchmark#803 Signed-off-by: Ryan Emerson <remerson@redhat.com>
This commit is contained in:
parent
5f2b9dc016
commit
5d0cb7959e
3 changed files with 42 additions and 39 deletions
|
@ -1,21 +0,0 @@
|
||||||
name: Delete Aurora Database
|
|
||||||
description: Delete AWS Aurora Database
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
name:
|
|
||||||
description: 'The name of the Aurora DB cluster to delete'
|
|
||||||
required: true
|
|
||||||
region:
|
|
||||||
description: 'The AWS region hosting the Aurora DB'
|
|
||||||
required: true
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- id: delete
|
|
||||||
shell: bash
|
|
||||||
run: ./aurora_delete.sh
|
|
||||||
working-directory: .github/scripts/aws/rds
|
|
||||||
env:
|
|
||||||
AURORA_CLUSTER: ${{ inputs.name }}
|
|
||||||
AURORA_REGION: ${{ inputs.region }}
|
|
34
.github/workflows/aurora-delete.yml
vendored
Normal file
34
.github/workflows/aurora-delete.yml
vendored
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
name: Aurora Delete
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
name:
|
||||||
|
description: 'The name of the Aurora DB cluster'
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
region:
|
||||||
|
description: 'The AWS region used to host the Aurora DB'
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
delete:
|
||||||
|
name: Delete Aurora DB
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Initialize AWS client
|
||||||
|
run: |
|
||||||
|
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
aws configure set region ${{ inputs.region }}
|
||||||
|
|
||||||
|
- id: delete
|
||||||
|
shell: bash
|
||||||
|
run: ./aurora_delete.sh
|
||||||
|
working-directory: .github/scripts/aws/rds
|
||||||
|
env:
|
||||||
|
AURORA_CLUSTER: ${{ inputs.name }}
|
||||||
|
AURORA_REGION: ${{ inputs.region }}
|
26
.github/workflows/ci.yml
vendored
26
.github/workflows/ci.yml
vendored
|
@ -357,20 +357,6 @@ jobs:
|
||||||
name: store-it-mvn-logs
|
name: store-it-mvn-logs
|
||||||
path: .github/scripts/ansible/files
|
path: .github/scripts/ansible/files
|
||||||
|
|
||||||
- name: Delete Aurora EC2 Instance
|
|
||||||
if: ${{ always() && matrix.db == 'aurora-postgres' }}
|
|
||||||
working-directory: .github/scripts/ansible
|
|
||||||
run: |
|
|
||||||
export CLUSTER_NAME=${{ steps.aurora-tests.outputs.ec2_cluster }}
|
|
||||||
./aws_ec2.sh delete ${{ steps.aurora-init.outputs.region }}
|
|
||||||
|
|
||||||
- name: Delete Aurora DB
|
|
||||||
if: ${{ always() && matrix.db == 'aurora-postgres' }}
|
|
||||||
uses: ./.github/actions/aurora-delete-database
|
|
||||||
with:
|
|
||||||
name: ${{ steps.aurora-init.outputs.name }}
|
|
||||||
region: ${{ steps.aurora-init.outputs.region }}
|
|
||||||
|
|
||||||
store-integration-tests:
|
store-integration-tests:
|
||||||
name: Store IT
|
name: Store IT
|
||||||
needs: [build, conditional]
|
needs: [build, conditional]
|
||||||
|
@ -488,10 +474,14 @@ jobs:
|
||||||
|
|
||||||
- name: Delete Aurora DB
|
- name: Delete Aurora DB
|
||||||
if: ${{ always() && matrix.db == 'aurora-postgres' }}
|
if: ${{ always() && matrix.db == 'aurora-postgres' }}
|
||||||
uses: ./.github/actions/aurora-delete-database
|
run: |
|
||||||
with:
|
gh workflow run aurora-delete.yml \
|
||||||
name: ${{ steps.aurora-init.outputs.name }}
|
-f name=${{ steps.aurora-init.outputs.name }} \
|
||||||
region: ${{ steps.aurora-init.outputs.region }}
|
-f region=${{ steps.aurora-init.outputs.region }} \
|
||||||
|
--repo ${{ github.repository }} \
|
||||||
|
--ref ${{ github.ref_name }}
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
store-model-tests:
|
store-model-tests:
|
||||||
name: Store Model Tests
|
name: Store Model Tests
|
||||||
|
|
Loading…
Reference in a new issue