Skip to content

Commit

Permalink
Add tags support to image generation script (#11367)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-Ayupov authored Jan 13, 2025
1 parent d1852f5 commit 8184167
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion images.CI/linux-and-win/build-image.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ param(
[String] [Parameter (Mandatory=$false)] $VirtualNetworkName,
[String] [Parameter (Mandatory=$false)] $VirtualNetworkRG,
[String] [Parameter (Mandatory=$false)] $VirtualNetworkSubnet,
[String] [Parameter (Mandatory=$false)] $AllowedInboundIpAddresses = "[]"
[String] [Parameter (Mandatory=$false)] $AllowedInboundIpAddresses = "[]",
[hashtable] [Parameter (Mandatory=$False)] $Tags = @{}
)

if (-not (Test-Path $TemplatePath))
Expand All @@ -33,6 +34,8 @@ $SensitiveData = @(
': ->'
)

$azure_tags = $Tags.GetEnumerator() | ForEach-Object { "{0}={1}" -f $_.Key, $_.Value } | Join-String -Separator ","

Write-Host "Show Packer Version"
packer --version

Expand All @@ -56,6 +59,7 @@ packer build -var "client_id=$ClientId" `
-var "virtual_network_resource_group_name=$VirtualNetworkRG" `
-var "virtual_network_subnet_name=$VirtualNetworkSubnet" `
-var "allowed_inbound_ip_addresses=$($AllowedInboundIpAddresses)" `
-var "azure_tags={$azure_tags}" `
-color=false `
$TemplatePath `
| Where-Object {
Expand Down

0 comments on commit 8184167

Please sign in to comment.