Skip to content

Commit f4bbcd1

Browse files
[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.
1 parent 721a53b commit f4bbcd1

6 files changed

+39
-4
lines changed

.azure-pipelines/azure-pipelines-UpgrateVersion.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@ parameters:
4242
stages:
4343
- stage: Build
4444
variables:
45-
CACHE_MODE: none
46-
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS='
45+
- name: CACHE_MODE
46+
value: none
47+
- name: VERSION_CONTROL_OPTIONS
48+
value: 'SONIC_VERSION_CONTROL_COMPONENTS='
49+
- template: .azure-pipelines/template-variables.yml@buildimage
4750
jobs:
4851
- template: azure-pipelines-build.yml
4952
parameters:

.azure-pipelines/docker-sonic-slave-template.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ jobs:
4545
pool: ${{ parameters.pool }}
4646
steps:
4747
- template: cleanup.yml
48-
- template: .azure-pipelines/template-clean-sonic-slave.yml@buildimage
48+
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
49+
- template: template-clean-sonic-slave.yml
50+
- ${{ else }}:
51+
- template: .azure-pipelines/template-variables.yml@buildimage
4952
- checkout: self
5053
clean: true
5154
submodules: recursive

.azure-pipelines/official-build.yml

+11
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,20 @@ schedules:
1212
- 202012
1313
always: true
1414

15+
resources:
16+
repositories:
17+
- repository: buildimage
18+
type: github
19+
name: Azure/sonic-buildimage
20+
ref: master
21+
endpoint: build
22+
1523
trigger: none
1624
pr: none
1725

26+
variables:
27+
- template: .azure-pipelines/template-variables.yml@buildimage
28+
1829
stages:
1930
- stage: Build
2031
pool: sonicbld
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
steps:
22
- script: |
3-
containers=$(docker container ls -a | grep "sonic-slave" | awk '{ print $1 }')
3+
set -x
4+
containers=$(docker container ls -aq)
45
[ -n "$containers" ] && docker container rm -f $containers
56
docker images | grep "^<none>" | awk '{print$3}' | xargs -i docker rmi {}
67
images=$(docker images 'sonic-slave-*' -a -q)
78
[ -n "$images" ] && docker rmi -f $images
9+
exit 0
810
displayName: 'Cleanup sonic slave'
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
variables:
2+
DEFAULT_CONTAINER_REGISTRY: 'publicmirror.azurecr.io'

azure-pipelines.yml

+14
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,20 @@ resources:
2929
type: github
3030
name: Azure/sonic-mgmt
3131
endpoint: build
32+
- repository: buildimage
33+
type: github
34+
name: Azure/sonic-buildimage
35+
endpoint: build
36+
ref: master
37+
38+
variables:
39+
- template: .azure-pipelines/azure-pipelines-repd-build-variables.yml
40+
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
41+
- template: .azure-pipelines/template-variables.yml
42+
- ${{ else }}:
43+
- template: .azure-pipelines/template-variables.yml@buildimage
44+
- name: CACHE_MODE
45+
value: rcache
3246

3347
stages:
3448
- stage: BuildVS

0 commit comments

Comments
 (0)