diff --git a/dokku b/dokku index 0dbeba176..6c16f0b3b 100755 --- a/dokku +++ b/dokku @@ -36,7 +36,7 @@ case "$1" in echo "-----> Deploying $APP ..." dokku deploy $APP echo "=====> Application deployed:" - echo "$(dokku url $APP | sed "s/^/ /")" + echo "$(dokku urls $APP | sed "s/^/ /")" echo ;; diff --git a/plugins/00_dokku-standard/commands b/plugins/00_dokku-standard/commands index ac55d4c8a..403b40c15 100755 --- a/plugins/00_dokku-standard/commands +++ b/plugins/00_dokku-standard/commands @@ -34,13 +34,26 @@ case "$1" in docker run -i -t $DOCKER_ARGS $IMAGE /exec "$@" ;; - url) + url | urls) [[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1 [[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1 - APP="$2"; + APP="$2"; SCHEME="http"; SSL="$DOKKU_ROOT/$APP/tls" + + if [[ -e "$SSL/server.crt" ]] && [[ -e "$SSL/server.key" ]]; then + SCHEME="https" + fi if [[ -f "$DOKKU_ROOT/$APP/VHOST" ]]; then - cat "$DOKKU_ROOT/$APP/VHOST" + case "$1" in + url) + echo "$SCHEME://$(head -n1 "$DOKKU_ROOT/$APP/VHOST")" + ;; + urls) + for vhost in $(< "$DOKKU_ROOT/$APP/VHOST"); do + echo "$SCHEME://$vhost" + done + ;; + esac fi ;; @@ -55,7 +68,8 @@ case "$1" in cat && cat< [-t] Show the last logs for an application (-t follows) run Run a command in the environment of an application - url Show the URL for an application + url Show the first URL for an application (compatibility) + urls Show all URLs for an application version Print dokku's version EOF ;;