implement ps:restartall. closes #82 #218

This commit is contained in:
Michael Hobbs
2015-01-14 16:37:18 -08:00
parent 9490889411
commit e760e1cc92
5 changed files with 13 additions and 12 deletions

View File

@@ -4,7 +4,8 @@ Dokku supports rudimentary process (really container) management via the `ps` pl
```
ps <app> List processes running in app container(s)
ps:restart <app> Restart app container(s)
ps:start <app> Start app container(s)
ps:stop <app> Stop app container(s)
ps:restart <app> Restart app container(s)
ps:restartall Restart all deployed app containers
```

View File

@@ -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.

8
dokku
View File

@@ -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 <app> [command-specific-options]"
echo ""

View File

@@ -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

View File

@@ -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<<EOF
ps <app> List processes running in app container(s)
ps:start <app> Start app container(s)
ps:stop <app> Stop app container(s)
ps:restart <app> Restart app container(s)
ps:restartall Restart all deployed app containers
EOF
;;