use different containers for different branches (#16434)
This commit is contained in:
parent
292c63430b
commit
a090b9eb5f
|
@ -24,6 +24,22 @@ jobs:
|
||||||
- checkout: self
|
- checkout: self
|
||||||
clean: true
|
clean: true
|
||||||
|
|
||||||
|
- pwsh: |
|
||||||
|
[string]$Branch=$env:BUILD_SOURCEBRANCH
|
||||||
|
$branchOnly = $Branch -replace '^refs/heads/';
|
||||||
|
$branchOnly = $branchOnly -replace '[_\-]'
|
||||||
|
|
||||||
|
if ($branchOnly -eq 'master') {
|
||||||
|
$container = 'tpn'
|
||||||
|
} else {
|
||||||
|
$container = "tpn-$branchOnly"
|
||||||
|
}
|
||||||
|
|
||||||
|
$vstsCommandString = "vso[task.setvariable variable=tpnContainer]$container"
|
||||||
|
Write-Verbose -Message $vstsCommandString -Verbose
|
||||||
|
Write-Host -Object "##$vstsCommandString"
|
||||||
|
displayName: Set ContainerName
|
||||||
|
|
||||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||||
displayName: 'Component Detection'
|
displayName: 'Component Detection'
|
||||||
inputs:
|
inputs:
|
||||||
|
@ -58,7 +74,7 @@ jobs:
|
||||||
azureSubscription: '$(AzureFileCopySubscription)'
|
azureSubscription: '$(AzureFileCopySubscription)'
|
||||||
Destination: AzureBlob
|
Destination: AzureBlob
|
||||||
storage: '$(StorageAccount)'
|
storage: '$(StorageAccount)'
|
||||||
ContainerName: 'tpn'
|
ContainerName: $(tpnContainer)
|
||||||
resourceGroup: '$(StorageResourceGroup)'
|
resourceGroup: '$(StorageResourceGroup)'
|
||||||
|
|
||||||
- task: PublishPipelineArtifact@1
|
- task: PublishPipelineArtifact@1
|
||||||
|
|
Loading…
Reference in a new issue