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
2013-07-26 08:12:09 -07:00

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 2> /dev/null &
# delete unused images
docker images | grep '<none>' | awk '{print $3}' | xargs docker rmi 2> /dev/null &
;;
plugins)
ls -1 -d $PLUGIN_PATH/*/
;;