-
-
Notifications
You must be signed in to change notification settings - Fork 96
/
connect
executable file
·24 lines (21 loc) · 1.01 KB
/
connect
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/config"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/functions"
service-connect-cmd() {
#E connect to the service via the $PLUGIN_COMMAND_PREFIX connection tool
#E > NOTE: disconnecting from ssh while running this command may leave zombie processes due to moby/moby#9098
#E dokku $PLUGIN_COMMAND_PREFIX:connect lollipop
#A service, service to run command against
declare desc="connect to the service via the $PLUGIN_COMMAND_PREFIX connection tool"
local cmd="$PLUGIN_COMMAND_PREFIX:connect" argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1
declare SERVICE="$1"
is_implemented_command "$cmd" || dokku_log_fail "Not yet implemented"
[[ -z "$SERVICE" ]] && dokku_log_fail "Please specify a valid name for the service"
verify_service_name "$SERVICE"
service_connect "$SERVICE"
}
service-connect-cmd "$@"