From e54aae284624173d6e05b24f9dd0df7f13f0947e Mon Sep 17 00:00:00 2001 From: Anton Belodedenko <2033996+ab77@users.noreply.github.com> Date: Thu, 27 Jun 2024 09:46:26 -0700 Subject: [PATCH] capture termination instance reason change-type: patch --- .github/workflows/tests.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3b7e7810a6..83b4292bea 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -439,6 +439,12 @@ jobs: source src/balena-tests/functions + function cleanup() { + aws ec2 describe-instances --instance-ids ${{ steps.balena-sut.outputs.instance_id }} \ + | jq -r .Reservations[].Instances[].StateReason + } + trap 'cleanup' EXIT + with_backoff balena login --token '${{ secrets.BALENA_API_KEY }}' if ! [[ -e "${HOME}/.ssh/id_rsa" ]]; then @@ -486,6 +492,12 @@ jobs: source src/balena-tests/functions + function cleanup() { + aws ec2 describe-instances --instance-ids ${{ steps.balena-sut.outputs.instance_id }} \ + | jq -r .Reservations[].Instances[].StateReason + } + trap 'cleanup' EXIT + with_backoff balena login --token '${{ secrets.BALENA_API_KEY }}' balena whoami && ssh-add -l @@ -544,6 +556,12 @@ jobs: source src/balena-tests/functions + function cleanup() { + aws ec2 describe-instances --instance-ids ${{ steps.balena-sut.outputs.instance_id }} \ + | jq -r .Reservations[].Instances[].StateReason + } + trap 'cleanup' EXIT + with_backoff balena login --token '${{ secrets.BALENA_API_KEY }}' balena whoami && ssh-add -l