mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[Windows] Az Modules Size Reduction On Image (#2827)
* [Windows] Az Modules Size Reduction On Image * Addressing review comments * Downloading azure and azurerm from blob storage
This commit is contained in:
@@ -36,6 +36,46 @@ foreach ($module in $modules)
|
||||
}
|
||||
}
|
||||
|
||||
if($null -ne $module.url)
|
||||
{
|
||||
$assets = Invoke-RestMethod $module.url
|
||||
}
|
||||
|
||||
foreach ($version in $module.zip_versions)
|
||||
{
|
||||
# Install modules from GH Release
|
||||
if($null -ne $assets)
|
||||
{
|
||||
$asset = $assets | Where-Object version -eq $version `
|
||||
| Select-Object -ExpandProperty files `
|
||||
| Select-Object -First 1
|
||||
|
||||
Write-Host "Installing $($module.name) $version ..."
|
||||
if ($null -ne $asset) {
|
||||
Start-DownloadWithRetry -Url $asset.download_url -Name $asset.filename -DownloadPath $installPSModulePath
|
||||
} else {
|
||||
Write-Host "Asset was not found in versions manifest"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
# Install modules from vsts blob
|
||||
else
|
||||
{
|
||||
$modulePath = Join-Path -Path $installPSModulePath -ChildPath "${moduleName}_${version}"
|
||||
$filename = "${moduleName}_${version}.zip"
|
||||
$download_url = [System.String]::Concat($module.blob_url,$filename)
|
||||
Write-Host " - $version [$modulePath]"
|
||||
try
|
||||
{
|
||||
Start-DownloadWithRetry -Url $download_url -Name $filename -DownloadPath $installPSModulePath
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host "Error: $_"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
}
|
||||
# Append default tool version to machine path
|
||||
if ($null -ne $module.default)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user