mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-04-20 23:36:29 -04:00
only upload directories if they exist
only delete resources if resources are left over added missing semicolons asdf same directory checks for constellation-iam-terraform
This commit is contained in:
parent
f661e416ad
commit
de2848e30c
@ -13,18 +13,22 @@ function download_tfstate_artifact {
|
||||
|
||||
# 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 destroy -auto-approve || exit 1
|
||||
cd ../../ || exit 1
|
||||
if [ -d "$1/constellation-terraform" ]; then
|
||||
cd "$1/constellation-terraform" || exit 1
|
||||
terraform init > /dev/null || exit 1 # first, install plugins
|
||||
terraform destroy -auto-approve || exit 1
|
||||
cd ../../ || exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# delete_iam_config runs terraform destroy on the constellation-iam-terraform subfolder of a given folder.
|
||||
function delete_iam_config {
|
||||
cd "$1/constellation-iam-terraform" || exit 1
|
||||
terraform init > /dev/null || exit 1 # first, install plugins
|
||||
terraform destroy -auto-approve || exit 1
|
||||
cd ../../ || exit 1
|
||||
if [ -d "$1/constellation-iam-terraform" ]; then
|
||||
cd "$1/constellation-iam-terraform" || exit 1
|
||||
terraform init > /dev/null || exit 1 # first, install plugins
|
||||
terraform destroy -auto-approve || exit 1
|
||||
cd ../../ || exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# check if the password for artifact decryption was given
|
||||
|
15
.github/workflows/e2e-test.yml
vendored
15
.github/workflows/e2e-test.yml
vendored
@ -283,11 +283,16 @@ jobs:
|
||||
if: always()
|
||||
shell: bash
|
||||
run: |
|
||||
rm -r to-zip/*
|
||||
cp -r constellation-terraform to-zip
|
||||
cp -r constellation-iam-terraform to-zip
|
||||
rm to-zip/constellation-terraform/plan.zip
|
||||
rm -rf to-zip/constellation-terraform/.terraform to-zip/constellation-iam-terraform/.terraform
|
||||
rm -rf to-zip/*
|
||||
if [ -d constellation-terraform ]; then
|
||||
cp -r constellation-terraform to-zip
|
||||
rm to-zip/constellation-terraform/plan.zip
|
||||
rm -rf to-zip/constellation-terraform/.terraform
|
||||
fi
|
||||
if [ -d constellation-iam-terraform ]; then
|
||||
cp -r constellation-iam-terraform to-zip
|
||||
rm -rf to-zip/constellation-iam-terraform/.terraform
|
||||
fi
|
||||
|
||||
- name: Update tfstate
|
||||
if: always()
|
||||
|
Loading…
x
Reference in New Issue
Block a user