mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
updated Jenkinsfile
This commit is contained in:
19
Jenkinsfile
vendored
19
Jenkinsfile
vendored
@@ -52,8 +52,23 @@ pipeline {
|
||||
steps {
|
||||
echo 'Cleanup...'
|
||||
sh """
|
||||
docker rmi `docker images | grep '<none>' | grep -v IMAGE | awk '{ print \$3 }' | xargs` | true
|
||||
docker rm `docker ps -a | grep Exited | awk '{ print \$1 }' | xargs` | true
|
||||
# remove unused containers
|
||||
container_ids=`docker ps -a | grep Exited | awk '{ print \$1 }' | xargs`
|
||||
if [ \$container_ids -eq "" ];
|
||||
then
|
||||
:
|
||||
else
|
||||
docker rm \$container_ids
|
||||
fi
|
||||
|
||||
# remove unused images
|
||||
image_ids=`docker images | grep '<none>' | grep -v IMAGE | awk '{ print \$3 }' | xargs`
|
||||
if [ \$image_ids -eq "" ];
|
||||
then
|
||||
:
|
||||
else
|
||||
docker rmi \$image_ids
|
||||
fi
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user