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 9ea3f2aca2 Update win2lin scripts to match production
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-06-08 11:08:23 -07: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 debian in the name
if [ ! $(docker images | sed -n '1!p' | grep -v 'docker' | grep -v 'debian' | 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 'debian' | 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