Skip to content

Commit f3872d5

Browse files
committed
always delete resources on deploy failure in CI
1 parent 6680549 commit f3872d5

File tree

2 files changed

+1
-45
lines changed

2 files changed

+1
-45
lines changed

.github/workflows/stackhpc.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,13 @@ jobs:
6666
cd $APPLIANCES_ENVIRONMENT_ROOT/terraform
6767
terraform apply -auto-approve
6868
69-
- name: Get server provisioning failure messages
70-
id: provision_failure
71-
run: |
72-
. venv/bin/activate
73-
. environments/.stackhpc/activate
74-
cd $APPLIANCES_ENVIRONMENT_ROOT/terraform
75-
TF_FAIL_MSGS="$(../../skeleton/\{\{cookiecutter.environment\}\}/terraform/getfaults.py $PWD)"
76-
echo TF failure messages: $TF_FAIL_MSGS
77-
echo "::set-output name=messages::${TF_FAIL_MSGS}"
78-
if: always() && steps.provision_servers.outcome == 'failure'
79-
8069
- name: Delete infrastructure if failed due to lack of hosts
8170
run: |
8271
. venv/bin/activate
8372
. environments/.stackhpc/activate
8473
cd $APPLIANCES_ENVIRONMENT_ROOT/terraform
8574
terraform destroy -auto-approve
86-
if: ${{ always() && steps.provision_servers.outcome == 'failure' && contains(steps.provision_failure.messages, 'not enough hosts available') }}
75+
if: ${{ steps.provision_servers.outcome == 'failure' }}
8776

8877
- name: Configure cluster
8978
run: |

environments/skeleton/{{cookiecutter.environment}}/terraform/getfaults.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)