Skip to content

Commit b2615a3

Browse files
TravisEz13unknown
authored andcommitted
use different containers for different branches (PowerShell#16434)
1 parent c6e3f0e commit b2615a3

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

tools/releaseBuild/azureDevOps/templates/compliance/generateNotice.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,22 @@ jobs:
2424
- checkout: self
2525
clean: true
2626

27+
- pwsh: |
28+
[string]$Branch=$env:BUILD_SOURCEBRANCH
29+
$branchOnly = $Branch -replace '^refs/heads/';
30+
$branchOnly = $branchOnly -replace '[_\-]'
31+
32+
if ($branchOnly -eq 'master') {
33+
$container = 'tpn'
34+
} else {
35+
$container = "tpn-$branchOnly"
36+
}
37+
38+
$vstsCommandString = "vso[task.setvariable variable=tpnContainer]$container"
39+
Write-Verbose -Message $vstsCommandString -Verbose
40+
Write-Host -Object "##$vstsCommandString"
41+
displayName: Set ContainerName
42+
2743
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
2844
displayName: 'Component Detection'
2945
inputs:
@@ -58,7 +74,7 @@ jobs:
5874
azureSubscription: '$(AzureFileCopySubscription)'
5975
Destination: AzureBlob
6076
storage: '$(StorageAccount)'
61-
ContainerName: 'tpn'
77+
ContainerName: $(tpnContainer)
6278
resourceGroup: '$(StorageResourceGroup)'
6379

6480
- task: PublishPipelineArtifact@1

0 commit comments

Comments
 (0)