issue #120 add step to clean up all dead instances and none used images

This commit is contained in:
alexanderbeletsky
2013-07-26 10:26:05 +03:00
parent bb59f47cab
commit 18db1cf7f6

11
dokku
View File

@@ -12,6 +12,10 @@ case "$1" in
echo "-----> Release complete!"
echo "-----> Deploying $APP ..."
dokku deploy $APP $IMAGE
echo "-----> Deploy complete!"
echo "-----> Cleaning up ..."
dokku cleanup
echo "-----> Cleanup complete!"
echo "=====> Application deployed:"
echo " $(dokku url $APP)"
echo
@@ -58,6 +62,13 @@ case "$1" in
pluginhook post-deploy $APP $port
;;
cleanup)
# delete all non-running container
docker ps -a | grep 'Exit' | awk '{print $1}' | xargs docker rm > /dev/null &
# delete unused images
docker images | grep '<none>' | awk '{print $3}' | xargs docker rmi > /dev/null &
;;
plugins)
ls -1 -d $PLUGIN_PATH/*/
;;