mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Avoid killing terminate-instances task
This commit is contained in:
parent
6a67ba91cf
commit
e1ac7477c9
@ -50,7 +50,9 @@ ROOT_STAT=($(df / | awk '/\// {print $4 " " int($4/$2 * 100)}'))
|
||||
if [[ ${ROOT_STAT[0]} -lt 3000000 ]] || [[ ${ROOT_STAT[1]} -lt 5 ]]; then
|
||||
echo "Going to terminate the runner, it has ${ROOT_STAT[0]}KiB and ${ROOT_STAT[1]}% of free space on /"
|
||||
INSTANCE_ID=$(ec2metadata --instance-id)
|
||||
( sleep 10 && aws ec2 terminate-instances --instance-ids "$INSTANCE_ID" ) &
|
||||
# We execute it with at to not have it as an orphan process
|
||||
# GH Runners kill all remain processes
|
||||
echo "sleep 10; aws ec2 terminate-instances --instance-ids $INSTANCE_ID" | at now
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user