mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 13:17:54 +00:00
Fail fast in image generation if not enough disk space for customers (#767)
* added checking free disk space Co-authored-by: Nikita Bykov <v-nibyko@microsoft.com>
This commit is contained in:
14
images/linux/scripts/installers/validate-disk-space.sh
Normal file
14
images/linux/scripts/installers/validate-disk-space.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
################################################################################
|
||||
## File: validate-disk-space.sh
|
||||
## Desc: Validate free disk space
|
||||
################################################################################
|
||||
|
||||
availableSpaceMB=$(df / -hm | sed 1d | awk '{ print $4}')
|
||||
minimumFreeSpaceMB=$(( 18*1024 ))
|
||||
|
||||
echo "Available disk space: $availableSpaceMB MB"
|
||||
if [ $availableSpaceMB -le $minimumFreeSpaceMB ]; then
|
||||
echo "Not enough disk space on the image (minimum available space: $minimumFreeSpaceMB MB)"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user