mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 22:05:17 +00:00
Add flag validation diskspace and set false(skip) step by default (#909)
* flag validation diskspace * display Available disk space * update image.CI * add image.CI flag * update env RUN_VALIDATION_FLAG
This commit is contained in:
committed by
GitHub
parent
e25d793c29
commit
521b0c5e28
@@ -54,6 +54,7 @@ packer build -var "capture_name_prefix=$ResourcesNamePrefix" `
|
||||
-var "virtual_network_name=$VirtualNetworkName" `
|
||||
-var "virtual_network_resource_group_name=$VirtualNetworkRG" `
|
||||
-var "virtual_network_subnet_name=$VirtualNetworkSubnet" `
|
||||
-var "run_validation_diskspace=$env:RUN_VALIDATION_FLAG" `
|
||||
$TemplatePath `
|
||||
| Where-Object {
|
||||
#Filter sensitive data from Packer logs
|
||||
|
||||
@@ -8,6 +8,12 @@ availableSpaceMB=$(df / -hm | sed 1d | awk '{ print $4}')
|
||||
minimumFreeSpaceMB=17800
|
||||
|
||||
echo "Available disk space: $availableSpaceMB MB"
|
||||
|
||||
if [ $RUN_VALIDATION != "true" ]; then
|
||||
echo "Skipping validation disk space..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $availableSpaceMB -le $minimumFreeSpaceMB ]; then
|
||||
echo "Not enough disk space on the image (minimum available space: $minimumFreeSpaceMB MB)"
|
||||
exit 1
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
"image_version": "dev",
|
||||
"image_os": "ubuntu16",
|
||||
"github_feed_token": null,
|
||||
"run_validation_diskspace": "false",
|
||||
"go_default": "1.14",
|
||||
"go_versions": "1.11 1.12 1.13 1.14"
|
||||
},
|
||||
@@ -344,6 +345,9 @@
|
||||
"type": "shell",
|
||||
"scripts":[
|
||||
"{{template_dir}}/scripts/installers/validate-disk-space.sh"
|
||||
],
|
||||
"environment_vars": [
|
||||
"RUN_VALIDATION={{user `run_validation_diskspace`}}"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
"image_version": "dev",
|
||||
"image_os": "ubuntu18",
|
||||
"github_feed_token": null,
|
||||
"run_validation_diskspace": "false",
|
||||
"go_default": "1.14",
|
||||
"go_versions": "1.11 1.12 1.13 1.14"
|
||||
},
|
||||
@@ -348,6 +349,9 @@
|
||||
"type": "shell",
|
||||
"scripts":[
|
||||
"{{template_dir}}/scripts/installers/validate-disk-space.sh"
|
||||
],
|
||||
"environment_vars": [
|
||||
"RUN_VALIDATION={{user `run_validation_diskspace`}}"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user