mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 22:26:56 +00:00
committed by
GitHub
parent
d09a712b71
commit
8077d7b42b
@@ -2,10 +2,10 @@ param(
|
||||
[String] [Parameter (Mandatory=$true)] $TemplatePath,
|
||||
[String] [Parameter (Mandatory=$true)] $ClientId,
|
||||
[String] [Parameter (Mandatory=$true)] $ClientSecret,
|
||||
[String] [Parameter (Mandatory=$true)] $ResourcesNamePrefix,
|
||||
[String] [Parameter (Mandatory=$true)] $Location,
|
||||
[String] [Parameter (Mandatory=$true)] $ResourceGroup,
|
||||
[String] [Parameter (Mandatory=$true)] $StorageAccount,
|
||||
[String] [Parameter (Mandatory=$true)] $ImageName,
|
||||
[String] [Parameter (Mandatory=$true)] $ImageResourceGroupName,
|
||||
[String] [Parameter (Mandatory=$true)] $TempResourceGroupName,
|
||||
[String] [Parameter (Mandatory=$true)] $SubscriptionId,
|
||||
[String] [Parameter (Mandatory=$true)] $TenantId,
|
||||
[String] [Parameter (Mandatory=$false)] $VirtualNetworkName,
|
||||
@@ -19,8 +19,7 @@ if (-not (Test-Path $TemplatePath))
|
||||
exit 1
|
||||
}
|
||||
|
||||
$Image = [io.path]::GetFileName($TemplatePath).Split(".")[0]
|
||||
$TempResourceGroupName = "${ResourcesNamePrefix}_${Image}"
|
||||
$ImageTemplateName = [io.path]::GetFileName($TemplatePath).Split(".")[0]
|
||||
$InstallPassword = [System.GUID]::NewGuid().ToString().ToUpper()
|
||||
|
||||
packer validate -syntax-only $TemplatePath
|
||||
@@ -38,14 +37,13 @@ $SensitiveData = @(
|
||||
Write-Host "Show Packer Version"
|
||||
packer --version
|
||||
|
||||
Write-Host "Build $Image VM"
|
||||
packer build -var "capture_name_prefix=$ResourcesNamePrefix" `
|
||||
-var "client_id=$ClientId" `
|
||||
Write-Host "Build $ImageTemplateName VM"
|
||||
packer build -var "client_id=$ClientId" `
|
||||
-var "client_secret=$ClientSecret" `
|
||||
-var "install_password=$InstallPassword" `
|
||||
-var "location=$Location" `
|
||||
-var "resource_group=$ResourceGroup" `
|
||||
-var "storage_account=$StorageAccount" `
|
||||
-var "managed_image_name=$ImageName" `
|
||||
-var "managed_image_resource_group_name=$ImageResourceGroupName" `
|
||||
-var "subscription_id=$SubscriptionId" `
|
||||
-var "temp_resource_group_name=$TempResourceGroupName" `
|
||||
-var "tenant_id=$TenantId" `
|
||||
|
||||
Reference in New Issue
Block a user