Merge pull request #180 from asm89/add-run-cmd
Add dokku run command to run commands in the app env
This commit is contained in:
commit
774b1f3c45
2 files changed
+22
No files matched your search
@@ -51,6 +51,13 @@ Let's deploy the [Heroku Node.js sample app](https://github.com/heroku/node-js-s
|
|||||||
|
|
||||||
You're done!
|
You're done!
|
||||||
|
|
||||||
|
## Run a command in the app environment
|
||||||
|
|
||||||
|
It's possible to run commands in the environment of the deployed application:
|
||||||
|
|
||||||
|
$ dokku run node-js-app ls -alh
|
||||||
|
$ dokku run <app> <cmd>
|
||||||
|
|
||||||
## Plugins
|
## Plugins
|
||||||
|
|
||||||
Dokku itself is built out of plugins. Checkout the wiki for information about
|
Dokku itself is built out of plugins. Checkout the wiki for information about
|
||||||
|
|||||||
@@ -5,9 +5,24 @@ set -e; case "$1" in
|
|||||||
docker logs $CONTAINER | tail -n 100
|
docker logs $CONTAINER | tail -n 100
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
run)
|
||||||
|
if [[ -z $2 ]]; then
|
||||||
|
echo "Please specify an app to run the command on"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
APP="$2"; IMAGE="app/$APP"
|
||||||
|
if [[ ! -d "/home/git/$APP" ]]; then
|
||||||
|
echo "App $APP does not exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shift 2
|
||||||
|
docker run $IMAGE /exec "$@"
|
||||||
|
;;
|
||||||
|
|
||||||
help)
|
help)
|
||||||
cat && cat<<EOF
|
cat && cat<<EOF
|
||||||
logs <app> Show the last logs for an application
|
logs <app> Show the last logs for an application
|
||||||
|
run <app> <cmd> Run a command in the environment of an application
|
||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user