From a75b04f20bbe5e7e7a7cae87d6e2c725a75878ef Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 10 Aug 2022 16:51:38 -0700 Subject: [PATCH] Add branch and deploy location (#452) --- eng/pipelines/template-tests.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) 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