adding some basic help, also as another example of using plugin hooks

This commit is contained in:
Jeff Lindsay
2013-06-30 15:51:41 -05:00
parent 997d2dd09c
commit 60f29cdb18
3 changed files with 22 additions and 2 deletions

14
dokku
View File

@@ -1,12 +1,12 @@
#!/bin/bash #!/bin/bash
set -e set -e
export PLUGIN_PATH="/var/lib/dokku/plugins" export PLUGIN_PATH=${PLUGIN_PATH:="/var/lib/dokku/plugins"}
case "$1" in case "$1" in
receive) receive)
APP="$2"; IMAGE="app/$APP" APP="$2"; IMAGE="app/$APP"
echo "-----> Building $APP ..." echo "-----> Building $APP ..."
cat | dokku build $IMAGE cat | dokku build $IMAGE
echo "=====> Build complete!" echo "-----> Build complete!"
echo "-----> Deploying $APP ..." echo "-----> Deploying $APP ..."
dokku deploy $APP $IMAGE dokku deploy $APP $IMAGE
echo "=====> Application deployed:" echo "=====> Application deployed:"
@@ -45,6 +45,16 @@ case "$1" in
pluginhook post-deploy $APP $port pluginhook post-deploy $APP $port
;; ;;
plugins) ls -1 -d $PLUGIN_PATH/*/
;;
help)
cat<<EOF | pluginhook commands help | sort
help Print the list of commands
plugins Print active plugins
EOF
;;
*) *)
pluginhook commands "$@" pluginhook commands "$@"
;; ;;

View File

@@ -8,5 +8,12 @@ set -e; case "$1" in
url) url)
echo "http://$(< "/home/git/$2/ADDRESS")" echo "http://$(< "/home/git/$2/ADDRESS")"
;; ;;
help)
cat && cat<<EOF
logs <app> Show the last logs for an application
url <app> Show the URL for an application
EOF
;;
esac esac

View File

@@ -8,5 +8,8 @@ set -e; case "$1" in
cat cat
fi fi
;; ;;
help) cat
;;
esac esac