From e760e1cc9297dc5945815b068d62c12ba3eb24eb Mon Sep 17 00:00:00 2001 From: Michael Hobbs Date: Wed, 14 Jan 2015 16:37:18 -0800 Subject: [PATCH] implement ps:restartall. closes #82 #218 --- docs/process-management.md | 3 ++- docs/upgrading.md | 2 +- dokku | 8 -------- plugins/00_dokku-standard/install | 4 ++-- plugins/ps/commands | 8 ++++++++ 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/docs/process-management.md b/docs/process-management.md index b832e33fe..0da24ae37 100644 --- a/docs/process-management.md +++ b/docs/process-management.md @@ -4,7 +4,8 @@ Dokku supports rudimentary process (really container) management via the `ps` pl ``` ps List processes running in app container(s) -ps:restart Restart app container(s) ps:start Start app container(s) ps:stop Stop app container(s) +ps:restart Restart app container(s) +ps:restartall Restart all deployed app containers ``` diff --git a/docs/upgrading.md b/docs/upgrading.md index 919d4bd5e..6af7ee298 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -60,7 +60,7 @@ There is an upgrade [script](https://gist.github.com/plietar/7201430), which is 1. run the script as root 2. `git pull` to get the latest version of dokku 3. make install -4. `dokku deploy:all` +4. `dokku ps:restartall` TDB. diff --git a/dokku b/dokku index 9f9819851..1afae5002 100755 --- a/dokku +++ b/dokku @@ -157,14 +157,6 @@ case "$1" in pluginhook update ;; - # temporary hack for https://github.com/progrium/dokku/issues/82 - deploy:all) - for app in $DOKKU_ROOT/*/CONTAINER; do - APP=$(basename "$(dirname $app)"); - dokku deploy $APP - done - ;; - help|'') echo "Usage: dokku COMMAND [command-specific-options]" echo "" diff --git a/plugins/00_dokku-standard/install b/plugins/00_dokku-standard/install index 91e93d2d8..02d743a18 100755 --- a/plugins/00_dokku-standard/install +++ b/plugins/00_dokku-standard/install @@ -20,7 +20,7 @@ start on (started docker) script sleep 2 # give docker some time - sudo -i -u dokku /usr/local/bin/dokku deploy:all + sudo -i -u dokku /usr/local/bin/dokku ps:restartall end script EOF ;; @@ -34,7 +34,7 @@ After=docker.target [Service] Type=simple User=dokku -ExecStart=/usr/local/bin/dokku deploy:all +ExecStart=/usr/local/bin/dokku ps:restartall [Install] WantedBy=multi-user.target diff --git a/plugins/ps/commands b/plugins/ps/commands index ca3ac5072..d0ae01076 100755 --- a/plugins/ps/commands +++ b/plugins/ps/commands @@ -66,12 +66,20 @@ case "$1" in release_and_deploy $APP ;; + ps:restartall) + for app in $DOKKU_ROOT/*/CONTAINER; do + APP=$(basename "$(dirname $app)"); + dokku ps:restart $APP + done + ;; + help | ps:help) cat && cat< List processes running in app container(s) ps:start Start app container(s) ps:stop Stop app container(s) ps:restart Restart app container(s) + ps:restartall Restart all deployed app containers EOF ;;