mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-01-22 21:31:14 -05:00
ci: clean up failed miniconstellation e2e tests (#3109)
This commit is contained in:
parent
79d3781f3e
commit
fbdc8f6e85
20
.github/actions/e2e_mini/action.yml
vendored
20
.github/actions/e2e_mini/action.yml
vendored
@ -11,6 +11,9 @@ inputs:
|
||||
azureTenantID:
|
||||
description: "Azure tenant to use for login with OIDC"
|
||||
required: true
|
||||
azureIAMCredentials:
|
||||
description: "Azure IAM credentials used for cleaning up resources"
|
||||
required: true
|
||||
registry:
|
||||
description: "Container registry to use"
|
||||
required: true
|
||||
@ -38,9 +41,26 @@ runs:
|
||||
|
||||
- name: MiniConstellation E2E
|
||||
shell: bash
|
||||
id: e2e-test
|
||||
env:
|
||||
ARM_CLIENT_ID: ${{ inputs.azureClientID }}
|
||||
ARM_SUBSCRIPTION_ID: ${{ inputs.azureSubscriptionID }}
|
||||
ARM_TENANT_ID: ${{ inputs.azureTenantID }}
|
||||
run: |
|
||||
bazel run --test_timeout=14400 //e2e/miniconstellation:push_remote_test
|
||||
|
||||
- name: Log in to azure
|
||||
# only log in if e2e test failed or if the run was cancelled
|
||||
if: (failure() && steps.e2e-test.conclusion == 'failure') || cancelled()
|
||||
uses: ./.github/actions/login_azure
|
||||
with:
|
||||
azure_credentials: ${{ inputs.azureIAMCredentials }}
|
||||
|
||||
- name: Clean up after failure
|
||||
shell: bash
|
||||
# clean up if e2e test failed or if the run was cancelled
|
||||
if: (failure() && steps.e2e-test.conclusion == 'failure') || cancelled()
|
||||
run: |
|
||||
rg_name=${{ steps.e2e-test.outputs.rgname }}
|
||||
echo "[*] Deleting resource group $rg_name"
|
||||
az group delete -y --resource-group "$rg_name"
|
||||
|
1
.github/workflows/e2e-mini.yml
vendored
1
.github/workflows/e2e-mini.yml
vendored
@ -46,5 +46,6 @@ jobs:
|
||||
azureClientID: ${{ secrets.AZURE_E2E_MINI_CLIENT_ID }}
|
||||
azureSubscriptionID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
||||
azureTenantID: ${{ secrets.AZURE_TENANT_ID }}
|
||||
azureIAMCredentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }}
|
||||
registry: ghcr.io
|
||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
1
.github/workflows/e2e-test-daily.yml
vendored
1
.github/workflows/e2e-test-daily.yml
vendored
@ -181,6 +181,7 @@ jobs:
|
||||
azureClientID: ${{ secrets.AZURE_E2E_MINI_CLIENT_ID }}
|
||||
azureSubscriptionID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
||||
azureTenantID: ${{ secrets.AZURE_TENANT_ID }}
|
||||
azureIAMCredentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }}
|
||||
registry: ghcr.io
|
||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
1
.github/workflows/e2e-test-weekly.yml
vendored
1
.github/workflows/e2e-test-weekly.yml
vendored
@ -455,6 +455,7 @@ jobs:
|
||||
azureClientID: ${{ secrets.AZURE_E2E_MINI_CLIENT_ID }}
|
||||
azureSubscriptionID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
||||
azureTenantID: ${{ secrets.AZURE_TENANT_ID }}
|
||||
azureIAMCredentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }}
|
||||
registry: ghcr.io
|
||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
@ -28,6 +28,9 @@ terraform apply -auto-approve
|
||||
terraform output -raw ssh_private_key > id_rsa
|
||||
chmod 600 id_rsa
|
||||
|
||||
rg_name=$(terraform output -raw rg_name)
|
||||
echo "rgname=$rg_name" >> "${GITHUB_OUTPUT:-/dev/null}"
|
||||
|
||||
azure_vm_ip=$(terraform output -raw public_ip)
|
||||
|
||||
echo "::endgroup::"
|
||||
|
@ -9,3 +9,9 @@ output "ssh_private_key" {
|
||||
sensitive = true
|
||||
depends_on = [tls_private_key.ssh_key]
|
||||
}
|
||||
|
||||
output "rg_name" {
|
||||
value = "e2e-mini-${random_string.suffix.result}"
|
||||
sensitive = false
|
||||
depends_on = [random_string.suffix]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user