[ci] Fix issues in docker-slave official build. (#10477)

only push latest tag on master build
This commit is contained in:
Shilong Liu 2022-04-07 13:02:35 +08:00 committed by GitHub
parent d83ae1e3dc
commit 0330253fd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -101,10 +101,13 @@ jobs:
containerRegistry: ${{ parameters.registry_conn }}
repository: $(VARIABLE_SLAVE_BASE_IMAGE)
command: push
tags: |
$(VARIABLE_SLAVE_BASE_TAG)
${{ if eq(variables['Build.SourceBranchName'], 'master') }}:
${{ if eq(variables['Build.SourceBranchName'], 'master') }}:
tags: |
$(VARIABLE_SLAVE_BASE_TAG)
latest
${{ else }}:
tags: |
$(VARIABLE_SLAVE_BASE_TAG)
- ${{ if ne(parameters.arch, 'amd64') }}:
- task: Docker@2
condition: ne(variables['Build.Reason'], 'PullRequest')

View File

@ -60,7 +60,7 @@ stages:
- ${{ each dist in parameters.dists }}:
- ${{ if endswith(variables['Build.DefinitionName'], dist) }}:
- ${{ each arch in parameters.arches }}:
- ${{ if eq(variables['System.PullRequest.TargetBranch'], 'master') }}:
- ${{ if eq(variables[''Build.Reason], 'PullRequest') }}:
- template: docker-sonic-slave-template.yml
parameters:
pool: sonicbld