Skip to content

Commit

Permalink
[ci] Fix remove sonic-slave-* docker image issue when building sonic-…
Browse files Browse the repository at this point in the history
…slave* (#10296) (#10378)
  • Loading branch information
liushilongbuaa authored Mar 30, 2022
1 parent e9db385 commit 491562b
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions .azure-pipelines/azure-pipelines-UpgrateVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ schedules:
- 202012
always: true

resources:
repositories:
- repository: buildimage
type: github
name: Azure/sonic-buildimage
ref: master
endpoint: build

pool: sonicbld

parameters:
Expand Down Expand Up @@ -42,17 +50,7 @@ stages:
buildOptions: '${{ variables.VERSION_CONTROL_OPTIONS }} SONIC_BUILD_JOBS=$(nproc) ENABLE_IMAGE_SIGNATURE=y'
jobFilters: ${{ parameters.jobFilters }}
preSteps:
- script: |
containers=$(docker container ls | grep "sonic-slave" | awk '{ print $1 }')
if [ ! -z "$containers" ]; then
docker container kill $containers || true
sleep 5
fi
images=$(docker images 'sonic-slave-*' -a -q)
if [ ! -z "$images" ]; then
docker rmi -f $images
fi
displayName: 'Cleanup sonic slave'
- template: .azure-pipelines/template-clean-sonic-slave.yml@buildimage
- stage: UpgradeVersions
jobs:
- job: UpgradeVersions
Expand Down

0 comments on commit 491562b

Please sign in to comment.