From 782a096e6bb7a2d342909e261bd55826499a0569 Mon Sep 17 00:00:00 2001 From: miampf Date: Mon, 26 Feb 2024 16:31:17 +0100 Subject: [PATCH] update state with remote state and dont error on failed downloads (eg if artifact doesnt exist) --- .github/actions/e2e_cleanup_timeframe/e2e-cleanup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/e2e_cleanup_timeframe/e2e-cleanup.sh b/.github/actions/e2e_cleanup_timeframe/e2e-cleanup.sh index b4bc34448..48aecfed9 100755 --- a/.github/actions/e2e_cleanup_timeframe/e2e-cleanup.sh +++ b/.github/actions/e2e_cleanup_timeframe/e2e-cleanup.sh @@ -8,13 +8,14 @@ function get_e2e_test_ids_on_date { # download_tfstate_artifact downloads all artifacts matching the pattern terraform-state-* from a given workflow ID. function download_tfstate_artifact { - gh run download "$1" -p "terraform-state-*" -R edgelesssys/constellation > /dev/null || exit 1 + gh run download "$1" -p "terraform-state-*" -R edgelesssys/constellation > /dev/null } # delete_resources runs terraform destroy on the constellation-terraform subfolder of a given folder. function delete_resources { cd "$1/constellation-terraform" || exit 1 terraform init > /dev/null || exit 1 # first, install plugins + terraform state pull > terraform.tfstate || exit 1 # update the local state with the remote state to only have resources over that have to be cleaned up. terraform destroy -auto-approve > /dev/null || exit 1 cd ../../ || exit 1 } @@ -23,6 +24,7 @@ function delete_resources { function delete_iam_config { cd "$1/constellation-iam-terraform" || exit 1 terraform init > /dev/null || exit 1 # first, install plugins + terraform state pull > terraform.tfstate || exit 1 # update the local state with the remote state to only have resources over that have to be cleaned up. terraform destroy -auto-approve > /dev/null || exit 1 cd ../../ || exit 1 }