Skip to content

Commit

Permalink
unused aws instace and vpcs cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: shiva kumar <shivaku@nvidia.com>
  • Loading branch information
shivakunv committed Dec 19, 2024
1 parent dd0d16c commit c07f700
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/awscleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,15 @@ jobs:
# 1. make sure .jobs exist in response
# e.g. { "message": "Not Found", "documentation_url": "https://docs.github.com/rest", "status": "404" }
# 2. check if all jobs completed
is_jobs_not_completed=1
echo "SHIVA $response"
jobs_exist=$(echo "$response" | jq -e '.jobs? // null' >/dev/null 2>&1; echo $?)
if [[ "$jobs_exist" -ne 0 ]]; then
is_jobs_not_completed=$(echo "$response" | jq -r ".jobs? // [] |
if ! echo "$response" | jq -e '.jobs != null' >/dev/null 2>&1; then
continue
fi
is_jobs_not_completed=$(echo "$response" | jq -r ".jobs? // [] |
map(select(.status != \"completed\")) |
length")
fi
if [[ "$is_jobs_not_completed" -eq 0 ]]; then
echo "Holodeck e2e Job status is not in running stage , Delete the vpc $vpc and dependent resources"
scripts/awscleanup.sh $vpc
Expand Down

0 comments on commit c07f700

Please sign in to comment.