mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Jenkinsfile: ensure all containers are cleaned up
By convention, containers spawned by jenkins jobs have the name: docker-pr${BUILD_NUMBER} That works fine for jobs with a single container. This commit cleans up when multiple containers are spawned with the convention that their names share the same "docker-pr${BUILD_NUMBER}-" prefix. Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
parent
ad1b781e44
commit
f470698c2c
1 changed files with 2 additions and 0 deletions
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
|
@ -701,6 +701,8 @@ pipeline {
|
|||
sh '''
|
||||
echo "Ensuring container killed."
|
||||
docker rm -vf docker-pr$BUILD_NUMBER || true
|
||||
cids=$(docker ps -aq -f name=docker-pr${BUILD_NUMBER}-*)
|
||||
[ -n "$cids" ] && docker rm -vf $cids || true
|
||||
'''
|
||||
|
||||
sh '''
|
||||
|
|
Loading…
Reference in a new issue