mirror of
https://github.com/actions/runner-images.git
synced 2025-12-24 18:39:49 +08:00
@@ -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`}}"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -454,6 +454,12 @@
|
||||
"elevated_user": "{{user `install_user`}}",
|
||||
"elevated_password": "{{user `install_password`}}"
|
||||
},
|
||||
{
|
||||
"type": "powershell",
|
||||
"scripts":[
|
||||
"{{ template_dir }}/scripts/Installers/Install-VSWhere.ps1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "powershell",
|
||||
"scripts":[
|
||||
@@ -954,6 +960,12 @@
|
||||
"{{ template_dir }}/scripts/Installers/Validate-Vcpkg.ps1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "powershell",
|
||||
"scripts":[
|
||||
"{{ template_dir }}/scripts/Installers/Validate-VSWhere.ps1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "powershell",
|
||||
"scripts":[
|
||||
|
||||
@@ -10,8 +10,11 @@
|
||||
$origPath = $env:PATH
|
||||
$gitPath = "$env:ProgramFiles\Git"
|
||||
|
||||
# get info from https://sourceforge.net/projects/msys2/files/Base/x86_64/
|
||||
$msys2Uri = "http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20190524.tar.xz"
|
||||
$msys2_release = "https://api.github.com/repos/msys2/msys2-installer/releases/latest"
|
||||
|
||||
$msys2Uri = ((Invoke-RestMethod $msys2_release).assets | Where-Object {
|
||||
$_.name -match "x86_64" -and $_.name.EndsWith("tar.xz") }).browser_download_url
|
||||
|
||||
$msys2File = "$env:TEMP\msys2.tar.xz"
|
||||
|
||||
# Download the latest msys2 x86_64
|
||||
@@ -19,13 +22,17 @@ Write-Host "Starting msys2 download"
|
||||
(New-Object System.Net.WebClient).DownloadFile($msys2Uri, $msys2File)
|
||||
Write-Host "Finished download"
|
||||
|
||||
$msys2FileU = "/$msys2File".replace(':', '')
|
||||
# nix style path for tar
|
||||
$msys2FileU = "/$msys2File".replace(':', '').replace('\', '/')
|
||||
|
||||
# Git tar needs exe's from mingw64\bin
|
||||
$env:PATH = "$gitPath\usr\bin;$gitPath\mingw64\bin;$origPath"
|
||||
|
||||
$tar = "$gitPath\usr\bin\tar.exe"
|
||||
|
||||
# extract tar.xz to C:\
|
||||
Write-Host "Starting msys2 extraction"
|
||||
&$tar -Jxf $msys2FileU -C /c/
|
||||
Write-Host "Starting msys2 extraction from $msys2FileU"
|
||||
&$tar -xJf $msys2FileU -C /c/
|
||||
Remove-Item $msys2File
|
||||
Write-Host "Finished extraction"
|
||||
|
||||
|
||||
@@ -62,6 +62,8 @@ $gccVersion = Get-ToolVersion -ToolPath "$msys2mingwDir/gcc" -VersionLineNumber
|
||||
$tarVersion = Get-ToolVersion -ToolPath "$msys2BinDir/tar" -VersionLineNumber 0
|
||||
|
||||
$Description = @"
|
||||
> _Note:_ MSYS2 is pre-installed on image but not added to PATH.
|
||||
|
||||
_Tool versions_
|
||||
_pacman:_ $pacmanVersion<br/>
|
||||
_bash:_ $bashVersion<br/>
|
||||
|
||||
@@ -94,7 +94,9 @@ $WorkLoads = '--allWorkloads --includeRecommended ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.Python ' + `
|
||||
'--remove Component.CPython3.x64 ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.Universal ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.VisualStudioExtension'
|
||||
'--add Microsoft.VisualStudio.Workload.VisualStudioExtension ' + `
|
||||
'--add Component.MDD.Linux ' + `
|
||||
'--add Component.MDD.Linux.GCC.arm'
|
||||
|
||||
$ReleaseInPath = "Enterprise"
|
||||
$BootstrapperUrl = "https://aka.ms/vs/16/release/vs_${ReleaseInPath}.exe"
|
||||
|
||||
Reference in New Issue
Block a user