github.com/ojongerius/docker@v1.11.2/hack/Jenkins/W2L/postbuild.sh (about)

     1  set +x
     2  set +e 
     3  
     4  echo ""
     5  echo ""
     6  echo "---"
     7  echo "Now starting POST-BUILD steps"
     8  echo "---"
     9  echo ""
    10  
    11  echo INFO: Pointing to $DOCKER_HOST
    12  
    13  if [ ! $(docker ps -aq | wc -l) -eq 0 ]; then
    14  	echo INFO: Removing containers...
    15  	! docker rm -vf $(docker ps -aq)
    16  fi
    17  
    18  # Remove all images which don't have docker or ubuntu in the name
    19  if [ ! $(docker images | sed -n '1!p' | grep -v 'docker' | grep -v 'ubuntu' | awk '{ print $3 }' | wc -l) -eq 0 ]; then 
    20  	echo INFO: Removing images...
    21  	! docker rmi -f $(docker images | sed -n '1!p' | grep -v 'docker' | grep -v 'ubuntu' | awk '{ print $3 }') 
    22  fi
    23  
    24  # Kill off any instances of git, go and docker, just in case
    25  ! taskkill -F -IM git.exe -T >& /dev/null
    26  ! taskkill -F -IM go.exe -T >& /dev/null
    27  ! taskkill -F -IM docker.exe -T >& /dev/null
    28  
    29  # Remove everything
    30  ! cd /c/jenkins/gopath/src/github.com/docker/docker
    31  ! rm -rfd * >& /dev/null
    32  ! rm -rfd .* >& /dev/null
    33  
    34  echo INFO: Cleanup complete
    35  exit 0