Merge pull request #121 from alexanderbeletsky/cleanup

issue #120 add step to clean up all dead instances and none used images
This commit is contained in:
Jeff Lindsay committed 2013-07-26 08:12:09 -07:00
commit eb189d639c
1 file changed
+11
+11
View File
@@ -12,6 +12,10 @@ case "$1" in
echo "-----> Release complete!" echo "-----> Release complete!"
echo "-----> Deploying $APP ..." echo "-----> Deploying $APP ..."
dokku deploy $APP $IMAGE dokku deploy $APP $IMAGE
echo "-----> Deploy complete!"
echo "-----> Cleaning up ..."
dokku cleanup
echo "-----> Cleanup complete!"
echo "=====> Application deployed:" echo "=====> Application deployed:"
echo " $(dokku url $APP)" echo " $(dokku url $APP)"
echo echo
@@ -58,6 +62,13 @@ case "$1" in
pluginhook post-deploy $APP $port pluginhook post-deploy $APP $port
;; ;;
cleanup)
# delete all non-running container
docker ps -a | grep 'Exit' | awk '{print $1}' | xargs docker rm 2> /dev/null &
# delete unused images
docker images | grep '<none>' | awk '{print $3}' | xargs docker rmi 2> /dev/null &
;;
plugins) plugins)
ls -1 -d $PLUGIN_PATH/*/ ls -1 -d $PLUGIN_PATH/*/
;; ;;