diff --git a/README.md b/README.md index f5a85b4a4..ba610a6ab 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,13 @@ Let's deploy the [Heroku Node.js sample app](https://github.com/heroku/node-js-s 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 + ## Plugins Dokku itself is built out of plugins. Checkout the wiki for information about diff --git a/plugins/00_dokku-standard/commands b/plugins/00_dokku-standard/commands index b638aa247..5a7dc3acb 100755 --- a/plugins/00_dokku-standard/commands +++ b/plugins/00_dokku-standard/commands @@ -5,9 +5,24 @@ set -e; case "$1" in 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) cat && cat< Show the last logs for an application + run Run a command in the environment of an application EOF ;; diff --git a/plugins/nginx-vhosts/commands b/plugins/nginx-vhosts/commands index 9ab20d5ab..75173b5f2 100755 --- a/plugins/nginx-vhosts/commands +++ b/plugins/nginx-vhosts/commands @@ -8,7 +8,7 @@ set -e; case "$1" in cat fi ;; - + help) cat && cat< Show the URL for an application EOF