mirror of
https://github.com/actions/runner-images.git
synced 2025-12-12 12:06:59 +00:00
Add the ability to specify Packer Azure plugin version (#11587)
This commit is contained in:
@@ -119,6 +119,8 @@ Function GenerateResourcesAndImage {
|
||||
The default is 'ask'.
|
||||
.PARAMETER Tags
|
||||
Tags to be applied to the Azure resources created.
|
||||
.PARAMETER PluginVersion
|
||||
Specify the version of the packer Azure plugin to use. The default is "2.2.1".
|
||||
.EXAMPLE
|
||||
GenerateResourcesAndImage -SubscriptionId {YourSubscriptionId} -ResourceGroupName "shsamytest1" -ImageGenerationRepositoryRoot "C:\runner-images" -ImageType Ubuntu2004 -AzureLocation "East US"
|
||||
#>
|
||||
@@ -144,6 +146,8 @@ Function GenerateResourcesAndImage {
|
||||
[Parameter(Mandatory = $False)]
|
||||
[string] $AzureTenantId,
|
||||
[Parameter(Mandatory = $False)]
|
||||
[string] $PluginVersion = "2.2.1",
|
||||
[Parameter(Mandatory = $False)]
|
||||
[switch] $RestrictToAgentIpAddress,
|
||||
[Parameter(Mandatory = $False)]
|
||||
[switch] $Force,
|
||||
@@ -218,7 +222,7 @@ Function GenerateResourcesAndImage {
|
||||
$InstallPassword = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper()
|
||||
|
||||
Write-Host "Downloading packer plugins..."
|
||||
& $PackerBinary init $TemplatePath
|
||||
& $PackerBinary plugins install github.com/hashicorp/azure $PluginVersion
|
||||
|
||||
if ($LastExitCode -ne 0) {
|
||||
throw "Packer plugins download failed."
|
||||
|
||||
Reference in New Issue
Block a user