diff --git a/eng/pipelines/template-tests.yml b/eng/pipelines/template-tests.yml index aa7a4d84f88..2fc07961e84 100644 --- a/eng/pipelines/template-tests.yml +++ b/eng/pipelines/template-tests.yml @@ -57,12 +57,30 @@ jobs: } displayName: Ensure $(AzdVersion) is set + - pwsh: | + if (!$env:TEMPLATEBRANCHNAME) { + Write-Host "TemplateBranchName variable not set. Using 'staging'" + Write-Host "##vso[task.setvariable variable=TemplateBranchName]staging" + } else { + Write-Host "Using specified azd version: $(TemplateBranchName)" + } + displayName: Ensure $(TemplateBranchName) is set + + - pwsh: | + if (!$env:DEPLOYLOCATION) { + Write-Host "DeployLocation variable not set. Using 'eastus'" + Write-Host "##vso[task.setvariable variable=DeployLocation]eastus" + } else { + Write-Host "Using specified azd version: $(DeployLocation)" + } + displayName: Ensure $(DeployLocation) is set + - bash: curl -fsSL https://aka.ms/install-azd.sh | bash -s -- --version '$(AzdVersion)' --verbose displayName: Install azd - pwsh: | $templateName = '$(TemplateName)'.Substring(14) - $resourceGroupName = "azd-template-test-$templateName-$(Build.BuildId)" + $resourceGroupName = "azd-template-test-$templateName-$(Build.BuildId)-rg" Write-Host "Resource group name: $resourceGroupName" Write-Host "##vso[task.setvariable variable=ResourceGroupName]$resourceGroupName" @@ -73,8 +91,9 @@ jobs: arguments: > -e 'azd-template-test' -t '$(TemplateName)' + -b '$(TemplateBranchName)' -s '$(Build.BuildId)' - -l 'centralus' + -l '$(DeployLocation)' -p 'list' workingDirectory: templates/tests displayName: Test templates