Skip to content

Misc fixes #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions .github/workflows/multinode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -362,16 +362,28 @@ jobs:

- name: Break on failure
run: |
sleep ${{ env.break_duration }}m
if: ${{ failure() && steps.config_ach.outcome == 'success' && contains(fromJSON('["failure", "always"]'), env.break_on) }}
sleep ${{ inputs.break_duration }}m
if: ${{ failure() && steps.config_ach.outcome == 'success' && contains(fromJSON('["failure", "always"]'), inputs.break_on) }}

- name: Break on success
run: |
sleep ${{ env.break_duration }}m
if: ${{ steps.config_ach.outcome == 'success' && contains(fromJSON('["success", "always"]'), env.break_on) }}
sleep ${{ inputs.break_duration }}m
if: ${{ steps.config_ach.outcome == 'success' && contains(fromJSON('["success", "always"]'), inputs.break_on) }}

- name: Destroy
run: terraform destroy -auto-approve -input=false
run: |
for attempt in $(seq 5); do
if terraform destroy -auto-approve -input=false -lock-timeout=200s; then
echo "Destroyed infrastructure on attempt $attempt"
exit 0
fi
echo "Failed to destroy infrastructure on attempt $attempt"
sleep 120
done
echo "Failed to destroy infrastructure after $attempt attempts"
echo "Forcefully destroying infrastructure"
terraform destroy -auto-approve -input=false -lock=false
exit 1
working-directory: ${{ github.workspace }}/terraform-kayobe-multinode
env:
OS_CLOUD: ${{ vars.OS_CLOUD }}
Expand Down