Skip to content

Commit

Permalink
Set a trap to report failed executions
Browse files Browse the repository at this point in the history
This commit modifies the CI scripts to deliver the status update in
case of a failure.

Signed-off-by: Mark Kirichenko <[email protected]>
  • Loading branch information
atanzu committed Jan 21, 2025
1 parent 895a8c6 commit ca3cc94
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ci_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,18 @@ then
exit 1
fi

trap 'STATE="failure"; status_update' ERR

STATE="pending"
status_update

echo "Running tests"

set +e
./scripts/run_tests.sh 2>&1 | tee test_logs.out
TEST_RESULTS=$?
set -e

echo "Finished running tests, uploading results to S3"

aws s3 cp --content-type 'text/plain' test_logs.out s3://aws-nitro-enclaves-cli/${LOGS_PATH}

Expand All @@ -58,4 +63,8 @@ if [[ "${TEST_RESULTS}" != "0" ]];then
STATE="failure"
fi

echo "Updating job status to ${STATE}"

status_update

echo "Done"

0 comments on commit ca3cc94

Please sign in to comment.