feat: properly handle custom aliases and error states for alias usage when calling link subcommand. Refs dokku/dokku-redis#64

This commit is contained in:
Jose Diaz-Gonzalez
2018-04-24 03:22:02 -04:00
parent 603a0c6e80
commit 0cb8bd5f9a
3 changed files with 19 additions and 8 deletions

View File

@@ -32,7 +32,7 @@ service-clone-cmd() {
service_parse_args "${@:3}"
dokku_log_info2 "Cloning $SERVICE to $NEW_SERVICE"
dokku_log_info2 "Cloning $SERVICE to $NEW_SERVICE @ $PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION"
service_create "$NEW_SERVICE" "${@:3}"
dokku_log_info1 "Copying data from $SERVICE to $NEW_SERVICE"
service_export "$SERVICE" | service_import "$NEW_SERVICE" > /dev/null 2>&1 || true

View File

@@ -39,6 +39,8 @@ service-link-cmd() {
#E ${PLUGIN_SCHEME}2://lolipop:SOME_PASSWORD@dokku-${PLUGIN_COMMAND_PREFIX}-lolipop:${PLUGIN_DATASTORE_PORTS[0]}/lolipop
#A service, service to run command against
#A app, app to run command against
#F -a|--alias "BLUE_DATABASE", an alternative alias to use for linking to an app via environment variable
#F -q|--querystring "pool=5", ampersand delimited querystring arguments to append to the service link
declare desc="link the $PLUGIN_SERVICE service to the app"
local cmd="$PLUGIN_COMMAND_PREFIX:link" argv=("$@"); [[ ${argv[0]} == "$cmd" ]] && shift 1
declare SERVICE="$1" APP="$2" LINK_FLAGS_LIST="${@:3}"