Cleanup json formatted packer template references (#9165)

This commit is contained in:
Shamil Mubarakshin
2024-01-15 16:40:23 +01:00
committed by GitHub
parent 5ee9ae1e60
commit 4d310f0a59
3 changed files with 11 additions and 38 deletions

View File

@@ -69,14 +69,7 @@ jobs:
$TemplateDirectoryPath = Join-Path "images" $TemplateDirectoryName | Resolve-Path
$TemplateFileName = "${{ parameters.image_template_name }}"
if ($TemplateFileName) {
$TemplatePath = Join-Path $TemplateDirectoryPath $TemplateFileName
} else {
$TemplatePath = Join-Path $TemplateDirectoryPath "$ImageType.pkr.hcl"
if ( -not (Test-Path $TemplatePath) ) {
$TemplatePath = Join-Path $TemplateDirectoryPath "$ImageType.json"
}
}
$TemplatePath = Join-Path $TemplateDirectoryPath $TemplateFileName
Write-Host "##vso[task.setvariable variable=TemplateDirectoryPath;]$TemplateDirectoryPath"
Write-Host "##vso[task.setvariable variable=TemplatePath;]$TemplatePath"