print out urls with scheme

This commit is contained in:
Michael Hobbs
2014-12-15 18:02:57 -08:00
parent 78d3921a6f
commit 50115d3640
2 changed files with 19 additions and 5 deletions

2
dokku
View File

@@ -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
;;

View File

@@ -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<<EOF
logs <app> [-t] Show the last logs for an application (-t follows)
run <app> <cmd> Run a command in the environment of an application
url <app> Show the URL for an application
url <app> Show the first URL for an application (compatibility)
urls <app> Show all URLs for an application
version Print dokku's version
EOF
;;