[ci] Set default ACR in UpgrateVersion/PR/official pipeline. (#10341)
Why I did it docker hub will limit the pull rate. Use ACR instead to pull debian related docker image. How I did it Set DEFAULT_CONTAINER_REGISTRY in pipeline.
This commit is contained in:
parent
a3aa8041b9
commit
9008132871
@ -45,8 +45,11 @@ parameters:
|
||||
stages:
|
||||
- stage: Build
|
||||
variables:
|
||||
CACHE_MODE: none
|
||||
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS='
|
||||
- name: CACHE_MODE
|
||||
value: none
|
||||
- name: VERSION_CONTROL_OPTIONS
|
||||
value: 'SONIC_VERSION_CONTROL_COMPONENTS='
|
||||
- template: .azure-pipelines/template-variables.yml@buildimage
|
||||
jobs:
|
||||
- template: azure-pipelines-build.yml
|
||||
parameters:
|
||||
|
@ -45,7 +45,10 @@ jobs:
|
||||
pool: ${{ parameters.pool }}
|
||||
steps:
|
||||
- template: cleanup.yml
|
||||
- template: .azure-pipelines/template-clean-sonic-slave.yml@buildimage
|
||||
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
|
||||
- template: template-clean-sonic-slave.yml
|
||||
- ${{ else }}:
|
||||
- template: .azure-pipelines/template-variables.yml@buildimage
|
||||
- checkout: self
|
||||
clean: true
|
||||
submodules: recursive
|
||||
|
@ -18,9 +18,20 @@ schedules:
|
||||
- 201911
|
||||
- 201811
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: buildimage
|
||||
type: github
|
||||
name: Azure/sonic-buildimage
|
||||
ref: master
|
||||
endpoint: build
|
||||
|
||||
trigger: none
|
||||
pr: none
|
||||
|
||||
variables:
|
||||
- template: .azure-pipelines/template-variables.yml@buildimage
|
||||
|
||||
stages:
|
||||
- stage: Build
|
||||
pool: sonicbld
|
||||
|
10
.azure-pipelines/template-clean-sonic-slave.yml
Normal file
10
.azure-pipelines/template-clean-sonic-slave.yml
Normal file
@ -0,0 +1,10 @@
|
||||
steps:
|
||||
- script: |
|
||||
set -x
|
||||
containers=$(docker container ls -aq)
|
||||
[ -n "$containers" ] && docker container rm -f $containers
|
||||
docker images | grep "^<none>" | awk '{print$3}' | xargs -i docker rmi {}
|
||||
images=$(docker images 'sonic-slave-*' -a -q)
|
||||
[ -n "$images" ] && docker rmi -f $images
|
||||
exit 0
|
||||
displayName: 'Cleanup sonic slave'
|
2
.azure-pipelines/template-variables.yml
Normal file
2
.azure-pipelines/template-variables.yml
Normal file
@ -0,0 +1,2 @@
|
||||
variables:
|
||||
DEFAULT_CONTAINER_REGISTRY: 'publicmirror.azurecr.io'
|
@ -30,9 +30,18 @@ resources:
|
||||
type: github
|
||||
name: Azure/sonic-mgmt
|
||||
endpoint: build
|
||||
- repository: buildimage
|
||||
type: github
|
||||
name: Azure/sonic-buildimage
|
||||
endpoint: build
|
||||
ref: master
|
||||
|
||||
variables:
|
||||
- template: .azure-pipelines/azure-pipelines-repd-build-variables.yml
|
||||
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
|
||||
- template: .azure-pipelines/template-variables.yml
|
||||
- ${{ else }}:
|
||||
- template: .azure-pipelines/template-variables.yml@buildimage
|
||||
- name: CACHE_MODE
|
||||
value: rcache
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user