Skip to content

Commit a75b04f

Browse files
authored
Add branch and deploy location (#452)
1 parent 49854e5 commit a75b04f

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

eng/pipelines/template-tests.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,30 @@ jobs:
5757
}
5858
displayName: Ensure $(AzdVersion) is set
5959
60+
- pwsh: |
61+
if (!$env:TEMPLATEBRANCHNAME) {
62+
Write-Host "TemplateBranchName variable not set. Using 'staging'"
63+
Write-Host "##vso[task.setvariable variable=TemplateBranchName]staging"
64+
} else {
65+
Write-Host "Using specified azd version: $(TemplateBranchName)"
66+
}
67+
displayName: Ensure $(TemplateBranchName) is set
68+
69+
- pwsh: |
70+
if (!$env:DEPLOYLOCATION) {
71+
Write-Host "DeployLocation variable not set. Using 'eastus'"
72+
Write-Host "##vso[task.setvariable variable=DeployLocation]eastus"
73+
} else {
74+
Write-Host "Using specified azd version: $(DeployLocation)"
75+
}
76+
displayName: Ensure $(DeployLocation) is set
77+
6078
- bash: curl -fsSL https://aka.ms/install-azd.sh | bash -s -- --version '$(AzdVersion)' --verbose
6179
displayName: Install azd
6280

6381
- pwsh: |
6482
$templateName = '$(TemplateName)'.Substring(14)
65-
$resourceGroupName = "azd-template-test-$templateName-$(Build.BuildId)"
83+
$resourceGroupName = "azd-template-test-$templateName-$(Build.BuildId)-rg"
6684
Write-Host "Resource group name: $resourceGroupName"
6785
Write-Host "##vso[task.setvariable variable=ResourceGroupName]$resourceGroupName"
6886
@@ -73,8 +91,9 @@ jobs:
7391
arguments: >
7492
-e 'azd-template-test'
7593
-t '$(TemplateName)'
94+
-b '$(TemplateBranchName)'
7695
-s '$(Build.BuildId)'
77-
-l 'centralus'
96+
-l '$(DeployLocation)'
7897
-p 'list'
7998
workingDirectory: templates/tests
8099
displayName: Test templates

0 commit comments

Comments
 (0)