1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/hack/Jenkins/W2L/postbuild.sh
John Howard d86f0d9b6d Check in latest Win2Lin Jenkins scripts
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-02-18 11:59:08 -08:00

35 lines
No EOL
935 B
Bash

set +x
set +e
echo ""
echo ""
echo "---"
echo "Now starting POST-BUILD steps"
echo "---"
echo ""
echo INFO: Pointing to $DOCKER_HOST
if [ ! $(docker ps -aq | wc -l) -eq 0 ]; then
echo INFO: Removing containers...
! docker rm -vf $(docker ps -aq)
fi
# Remove all images which don't have docker or ubuntu in the name
if [ ! $(docker images | sed -n '1!p' | grep -v 'docker' | grep -v 'ubuntu' | awk '{ print $3 }' | wc -l) -eq 0 ]; then
echo INFO: Removing images...
! docker rmi -f $(docker images | sed -n '1!p' | grep -v 'docker' | grep -v 'ubuntu' | awk '{ print $3 }')
fi
# Kill off any instances of git, go and docker, just in case
! taskkill -F -IM git.exe -T >& /dev/null
! taskkill -F -IM go.exe -T >& /dev/null
! taskkill -F -IM docker.exe -T >& /dev/null
# Remove everything
! cd /c/jenkins/gopath/src/github.com/docker/docker
! rm -rfd * >& /dev/null
! rm -rfd .* >& /dev/null
echo INFO: Cleanup complete
exit 0