From c773e5250860c3a6e77b6acc8101d4a204c5b937 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 18 Aug 2013 14:19:41 +0200 Subject: [PATCH 1/4] Add dokku run-cli command to run commands in the app env --- plugins/00_dokku-standard/commands | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugins/00_dokku-standard/commands b/plugins/00_dokku-standard/commands index afe27d8a6..7a392aa6d 100755 --- a/plugins/00_dokku-standard/commands +++ b/plugins/00_dokku-standard/commands @@ -5,6 +5,20 @@ set -e; case "$1" in docker logs $CONTAINER | tail -n 100 ;; + run-cli) + 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 /run-cli "$@" + ;; + help) cat && cat< Show the last logs for an application From 2563581f49758565b3b77a70732c17ecb8dac220 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 18 Aug 2013 14:32:14 +0200 Subject: [PATCH 2/4] Update help command --- dokku | 6 +++--- plugins/00_dokku-standard/commands | 3 ++- plugins/nginx-vhosts/commands | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dokku b/dokku index 637b6379a..01bd228fb 100755 --- a/dokku +++ b/dokku @@ -90,9 +90,9 @@ case "$1" in help) cat< Show the last logs for an application + logs Show the last logs for an application + run-cli Run a command in the environment of an application EOF ;; diff --git a/plugins/nginx-vhosts/commands b/plugins/nginx-vhosts/commands index b19ba1bfc..eb0efe4b6 100755 --- a/plugins/nginx-vhosts/commands +++ b/plugins/nginx-vhosts/commands @@ -8,9 +8,9 @@ set -e; case "$1" in cat fi ;; - + help) cat && cat< Show the URL for an application + url Show the URL for an application EOF ;; From 3e9e6127a79987e534994f79791450e12ac64de6 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 21 Aug 2013 00:02:52 +0200 Subject: [PATCH 3/4] run-cli -> run, fix help formatting --- dokku | 6 +++--- plugins/00_dokku-standard/commands | 8 ++++---- plugins/nginx-vhosts/commands | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dokku b/dokku index 01bd228fb..637b6379a 100755 --- a/dokku +++ b/dokku @@ -90,9 +90,9 @@ case "$1" in help) cat< Show the last logs for an application - run-cli Run a command in the environment of an application + logs 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 eb0efe4b6..6b6731a3a 100755 --- a/plugins/nginx-vhosts/commands +++ b/plugins/nginx-vhosts/commands @@ -10,7 +10,7 @@ set -e; case "$1" in ;; help) cat && cat< Show the URL for an application + url Show the URL for an application EOF ;; From 7b8b8172e89049126b1656778169b3dac12237c8 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 21 Aug 2013 23:46:35 +0200 Subject: [PATCH 4/4] Add run command to README --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) 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