Skip to content

Commit 09029f0

Browse files
[ci] Fix remove sonic-slave-* docker image issue when building sonic-slave* (sonic-net#10296)
1 parent 308ecbb commit 09029f0

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ schedules:
1414
- 202012
1515
always: true
1616

17+
resources:
18+
repositories:
19+
- repository: buildimage
20+
type: github
21+
name: Azure/sonic-buildimage
22+
ref: master
23+
endpoint: build
24+
1725
pool: sonicbld
1826

1927
parameters:
@@ -42,17 +50,7 @@ stages:
4250
buildOptions: '${{ variables.VERSION_CONTROL_OPTIONS }} SONIC_BUILD_JOBS=$(nproc) ENABLE_IMAGE_SIGNATURE=y'
4351
jobFilters: ${{ parameters.jobFilters }}
4452
preSteps:
45-
- script: |
46-
containers=$(docker container ls | grep "sonic-slave" | awk '{ print $1 }')
47-
if [ ! -z "$containers" ]; then
48-
docker container kill $containers || true
49-
sleep 5
50-
fi
51-
images=$(docker images 'sonic-slave-*' -a -q)
52-
if [ ! -z "$images" ]; then
53-
docker rmi -f $images
54-
fi
55-
displayName: 'Cleanup sonic slave'
53+
- template: .azure-pipelines/template-clean-sonic-slave.yml@buildimage
5654
- stage: UpgradeVersions
5755
jobs:
5856
- job: UpgradeVersions

0 commit comments

Comments
 (0)