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 <[email protected]>
  • Loading branch information
shivakunv committed Dec 19, 2024
1 parent bc1c896 commit 385fcb7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/awscleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,13 @@ jobs:
if [[ -z "$response" || "$response" == "null" ]]; then
continue
fi
echo $response
exit 0
status=$(echo "$response" | jq -r ".jobs? // [] | map(select(.name | test(\"^$job_name\"))) | .[0]?.status // \"null\"" 2>/dev/null || echo "null")
if [[ "$status" != "null" && ! -z "$status" && $(echo "$status" | grep -qvE '^(queued|in_progress)$'; echo $?) -eq 0 ]]; then
echo "SHIVA $response"
is_job_running=$(echo "$response" | jq -r "
.jobs? // [] |
map(select(.status == \"in_progress\" or .status == \"queued\")) |
length
")
if [[ "$is_job_running" -eq 0 ]]; then
echo "Holodeck e2e Job status is not in running stage , Delete the dependent resources"
scripts/awscleanup.sh $vpc
fi
Expand Down

0 comments on commit 385fcb7

Please sign in to comment.