diff --git a/docs/upgrading.md b/docs/upgrading.md index f1b234eac..e2041e731 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -42,7 +42,7 @@ dokku ps:rebuildall If dokku was installed via a debian package, you can upgrade herokuish via the following command: ```shell -sudo apt-get install Herokush +sudo apt-get install herokuish ``` For unattended upgrades, you may run the following command: diff --git a/dokku b/dokku index c3dd36337..b15993024 100755 --- a/dokku +++ b/dokku @@ -80,6 +80,16 @@ case "$1" in DOKKU_RESTART_LIMIT=$(dokku config:get $APP DOKKU_RESTART_LIMIT || echo 10) DOKKU_RESTART_LIMIT=${DOKKU_RESTART_LIMIT:=10} + DOKKU_APP_SKIP_ALL_CHECKS=$(dokku config:get $APP DOKKU_SKIP_ALL_CHECKS || true) + DOKKU_APP_SKIP_DEFAULT_CHECKS=$(dokku config:get $APP DOKKU_SKIP_DEFAULT_CHECKS || true) + DOKKU_GLOBAL_SKIP_ALL_CHECKS=$(dokku config:get --global DOKKU_SKIP_ALL_CHECKS || true) + DOKKU_GLOBAL_SKIP_DEFAULT_CHECKS=$(dokku config:get --global DOKKU_SKIP_DEFAULT_CHECKS || true) + + DOKKU_SKIP_ALL_CHECKS=${DOKKU_APP_SKIP_ALL_CHECKS:="$DOKKU_GLOBAL_SKIP_ALL_CHECKS"} + DOKKU_SKIP_DEFAULT_CHECKS=${DOKKU_APP_SKIP_DEFAULT_CHECKS:="$DOKKU_GLOBAL_SKIP_DEFAULT_CHECKS"} + + DOKKU_DEFAULT_DOCKER_ARGS=$(: | plugn trigger docker-args-deploy $APP $IMAGE_TAG) + while read line || [[ -n "$line" ]]; do TRIM=${line%#*} PROC_TYPE=${TRIM%%=*} @@ -93,9 +103,9 @@ case "$1" in DOKKU_PORT_FILE="$DOKKU_ROOT/$APP/PORT.$PROC_TYPE.$CONTAINER_INDEX" # start the app - DOCKER_ARGS=" -e DYNO='$PROC_TYPE.$CONTAINER_INDEX' " + DOCKER_ARGS="$DOKKU_DEFAULT_DOCKER_ARGS" + DOCKER_ARGS+=" -e DYNO='$PROC_TYPE.$CONTAINER_INDEX' " DOCKER_ARGS+=" --restart=on-failure:$DOKKU_RESTART_LIMIT" - DOCKER_ARGS+=$(: | plugn trigger docker-args-deploy $APP $IMAGE_TAG) [[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true " BIND_EXTERNAL=$(plugn trigger bind-external-ip $APP) @@ -127,14 +137,6 @@ case "$1" in kill -9 $$ } - DOKKU_APP_SKIP_ALL_CHECKS=$(dokku config:get $APP DOKKU_SKIP_ALL_CHECKS || true) - DOKKU_APP_SKIP_DEFAULT_CHECKS=$(dokku config:get $APP DOKKU_SKIP_DEFAULT_CHECKS || true) - DOKKU_GLOBAL_SKIP_ALL_CHECKS=$(dokku config:get --global DOKKU_SKIP_ALL_CHECKS || true) - DOKKU_GLOBAL_SKIP_DEFAULT_CHECKS=$(dokku config:get --global DOKKU_SKIP_DEFAULT_CHECKS || true) - - DOKKU_SKIP_ALL_CHECKS=${DOKKU_APP_SKIP_ALL_CHECKS:="$DOKKU_GLOBAL_SKIP_ALL_CHECKS"} - DOKKU_SKIP_DEFAULT_CHECKS=${DOKKU_APP_SKIP_DEFAULT_CHECKS:="$DOKKU_GLOBAL_SKIP_DEFAULT_CHECKS"} - # run checks first, then post-deploy hooks, which switches Nginx traffic if [[ "$DOKKU_SKIP_ALL_CHECKS" = "true" ]]; then dokku_log_info1 "Skipping pre-flight checks" diff --git a/plugins/00_dokku-standard/commands b/plugins/00_dokku-standard/commands index 4e3eb5141..a3dc43779 100755 --- a/plugins/00_dokku-standard/commands +++ b/plugins/00_dokku-standard/commands @@ -1,4 +1,5 @@ #!/usr/bin/env bash +[[ " build release trace delete ls logs run url urls version help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" diff --git a/plugins/20_events/commands b/plugins/20_events/commands index 11f3a2b15..582b5c38f 100755 --- a/plugins/20_events/commands +++ b/plugins/20_events/commands @@ -1,9 +1,8 @@ #!/usr/bin/env bash +[[ " events events:on events:off events:list help events:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" -PLUGIN_DIR="$(dirname $0)" - case "$1" in events) if [[ -f $DOKKU_EVENTS_LOGFILE ]]; then @@ -27,6 +26,7 @@ case "$1" in ;; events:list) + PLUGIN_DIR="$(dirname $0)" if [[ "$DOKKU_EVENTS" ]]; then logged="$(find $PLUGIN_DIR -type l -printf '%f ' | sort)" dokku_col_log_info2_quiet "Events currently logged" diff --git a/plugins/apps/commands b/plugins/apps/commands index 93052e0d0..a73e97975 100755 --- a/plugins/apps/commands +++ b/plugins/apps/commands @@ -1,4 +1,5 @@ #!/usr/bin/env bash +[[ " apps apps:create apps:destroy help apps:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" diff --git a/plugins/backup/commands b/plugins/backup/commands index 2fa160979..90f28a4ad 100755 --- a/plugins/backup/commands +++ b/plugins/backup/commands @@ -1,10 +1,10 @@ #!/usr/bin/env bash +[[ " backup:export backup:import help backup:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -CURRENT_BACKUP_VERSION=1 - case "$1" in backup:export) + CURRENT_BACKUP_VERSION=1 OUTPUT_FILE="$2" BACKUP_DIR="$DOKKU_ROOT" diff --git a/plugins/certs/commands b/plugins/certs/commands index 2dea833fc..870cd48cf 100755 --- a/plugins/certs/commands +++ b/plugins/certs/commands @@ -1,4 +1,5 @@ #!/usr/bin/env bash +[[ " certs:add certs:generate certs:info certs:remove certs:update help certs:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/certs/functions" diff --git a/plugins/config/commands b/plugins/config/commands index 191af9f52..f5b929449 100755 --- a/plugins/config/commands +++ b/plugins/config/commands @@ -1,4 +1,5 @@ #!/usr/bin/env bash +[[ " config config:get config:set config:unset help config:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" diff --git a/plugins/config/functions b/plugins/config/functions index 6e727623d..766de5103 100644 --- a/plugins/config/functions +++ b/plugins/config/functions @@ -211,7 +211,7 @@ config_unset() { for var in $VARS; do dokku_log_info1 "Unsetting $var" - ENV_TEMP=$(echo -e "${ENV_TEMP}" | sed "/^export $var=/ d") + ENV_TEMP=$(echo "${ENV_TEMP}" | sed "/^export $var=/ d") config_write "$ENV_TEMP" [[ "$var" == "NO_VHOST" ]] && config_set --no-restart $APP NO_VHOST=0 && DOKKU_CONFIG_RESTART=true diff --git a/plugins/docker-options/commands b/plugins/docker-options/commands index b7f63c55d..2a9589978 100755 --- a/plugins/docker-options/commands +++ b/plugins/docker-options/commands @@ -1,11 +1,8 @@ #!/usr/bin/env bash +[[ " docker-options docker-options:add docker-options:remove help docker-options:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" -PHASES=(build deploy run) - -FILE_PREFIX="DOCKER_OPTIONS_" - get_app() { [[ -z $1 ]] && dokku_log_fail "Please specify an app to run the command on" verify_app_name "$1" @@ -25,17 +22,19 @@ get_phases() { verify_phase() { local phase - for phase in "${PHASES[@]}"; do + local phases=(build deploy run) + for phase in "${phases[@]}"; do if [[ "$phase" = "$1" ]]; then return 0 fi done - dokku_log_fail "Phase(s) must be one of [${PHASES[@]}]" + dokku_log_fail "Phase(s) must be one of [${phases[@]}]" } get_phase_file_path() { local phase=$1 - phase_file_path="${DOKKU_ROOT}/${APP}/${FILE_PREFIX}${phase^^}" + local prefix="DOCKER_OPTIONS_" + phase_file_path="${DOKKU_ROOT}/${APP}/${prefix}${phase^^}" } create_phase_file_if_required() { @@ -53,7 +52,8 @@ display_phase_options() { } display_all_phases_options() { - for phase in "${PHASES[@]}"; do + local phases=(build deploy run) + for phase in "${phases[@]}"; do get_phase_file_path $phase if [[ -s $phase_file_path ]]; then display_phase_options $phase $phase_file_path @@ -139,7 +139,7 @@ case "$1" in ;; # Display usage help - help) + help | docker-options:help) cat<, Display apps docker options for all phases docker-options , Display apps docker options for phase (comma separated phase list) diff --git a/plugins/domains/commands b/plugins/domains/commands index f67f7648e..0208368a9 100755 --- a/plugins/domains/commands +++ b/plugins/domains/commands @@ -1,29 +1,10 @@ #!/usr/bin/env bash +[[ " domains domains:setup domains:add domains:clear domains:remove help domains:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions" -RE_IPV4="([0-9]{1,3}[\.]){3}[0-9]{1,3}" - -RE_IPV6="([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|" # TEST: 1:2:3:4:5:6:7:8 -RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,7}:|" # TEST: 1:: 1:2:3:4:5:6:7:: -RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|" # TEST: 1::8 1:2:3:4:5:6::8 1:2:3:4:5:6::8 -RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|" # TEST: 1::7:8 1:2:3:4:5::7:8 1:2:3:4:5::8 -RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|" # TEST: 1::6:7:8 1:2:3:4::6:7:8 1:2:3:4::8 -RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|" # TEST: 1::5:6:7:8 1:2:3::5:6:7:8 1:2:3::8 -RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|" # TEST: 1::4:5:6:7:8 1:2::4:5:6:7:8 1:2::8 -RE_IPV6="${RE_IPV6}[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|" # TEST: 1::3:4:5:6:7:8 1::3:4:5:6:7:8 1::8 -RE_IPV6="${RE_IPV6}:((:[0-9a-fA-F]{1,4}){1,7}|:)|" # TEST: ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 :: -RE_IPV6="${RE_IPV6}fe08:(:[0-9a-fA-F]{1,4}){2,2}%[0-9a-zA-Z]{1,}|" # TEST: fe08::7:8%eth0 fe08::7:8%1 (link-local IPv6 addresses with zone index) -RE_IPV6="${RE_IPV6}::(ffff(:0{1,4}){0,1}:){0,1}${RE_IPV4}|" # TEST: ::255.255.255.255 ::ffff:255.255.255.255 ::ffff:0:255.255.255.255 (IPv4-mapped IPv6 addresses and IPv4-translated addresses) -RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,4}:${RE_IPV4}" # TEST: 2001:db8:3:4::192.0.2.33 64:ff9b::192.0.2.33 - -# Ensure the ip address continues to the end of the line -# Fixes using a wildcard dns service such as xip.io which allows for *..xip.io -RE_IPV4="${RE_IPV4}\$" -RE_IPV6="${RE_IPV6}\$" - case "$1" in domains) [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" @@ -43,6 +24,7 @@ case "$1" in [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" verify_app_name "$2" APP="$2"; VHOST_PATH="$DOKKU_ROOT/$APP/VHOST" + RE_IPV4="$(get_ipv4_regex)"; RE_IPV6="$(get_ipv6_regex)" if [[ ! -f $VHOST_PATH ]]; then if [[ -f "$DOKKU_ROOT/VHOST" ]]; then diff --git a/plugins/enter/commands b/plugins/enter/commands index b8e0bdbdc..b69217e98 100755 --- a/plugins/enter/commands +++ b/plugins/enter/commands @@ -1,4 +1,5 @@ #!/usr/bin/env bash +[[ " enter help enter:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" diff --git a/plugins/nginx-vhosts/commands b/plugins/nginx-vhosts/commands index 44e03a27d..f48f29d6e 100755 --- a/plugins/nginx-vhosts/commands +++ b/plugins/nginx-vhosts/commands @@ -1,4 +1,5 @@ #!/usr/bin/env bash +[[ " nginx:build-config nginx:access-logs nginx:error-logs nginx:disable nginx:enable help nginx:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" diff --git a/plugins/nginx-vhosts/functions b/plugins/nginx-vhosts/functions index 9221b77dc..dd441d75d 100755 --- a/plugins/nginx-vhosts/functions +++ b/plugins/nginx-vhosts/functions @@ -5,6 +5,41 @@ source "$PLUGIN_AVAILABLE_PATH/certs/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" +_ipv4_regex() { + echo "([0-9]{1,3}[\.]){3}[0-9]{1,3}" +} + +_ipv6_regex() { + local RE_IPV4="$(_ipv4_regex)" + local RE_IPV6="([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|" # TEST: 1:2:3:4:5:6:7:8 + RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,7}:|" # TEST: 1:: 1:2:3:4:5:6:7:: + RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|" # TEST: 1::8 1:2:3:4:5:6::8 1:2:3:4:5:6::8 + RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|" # TEST: 1::7:8 1:2:3:4:5::7:8 1:2:3:4:5::8 + RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|" # TEST: 1::6:7:8 1:2:3:4::6:7:8 1:2:3:4::8 + RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|" # TEST: 1::5:6:7:8 1:2:3::5:6:7:8 1:2:3::8 + RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|" # TEST: 1::4:5:6:7:8 1:2::4:5:6:7:8 1:2::8 + RE_IPV6="${RE_IPV6}[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|" # TEST: 1::3:4:5:6:7:8 1::3:4:5:6:7:8 1::8 + RE_IPV6="${RE_IPV6}:((:[0-9a-fA-F]{1,4}){1,7}|:)|" # TEST: ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 :: + RE_IPV6="${RE_IPV6}fe08:(:[0-9a-fA-F]{1,4}){2,2}%[0-9a-zA-Z]{1,}|" # TEST: fe08::7:8%eth0 fe08::7:8%1 (link-local IPv6 addresses with zone index) + RE_IPV6="${RE_IPV6}::(ffff(:0{1,4}){0,1}:){0,1}${RE_IPV4}|" # TEST: ::255.255.255.255 ::ffff:255.255.255.255 ::ffff:0:255.255.255.255 (IPv4-mapped IPv6 addresses and IPv4-translated addresses) + RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,4}:${RE_IPV4}" # TEST: 2001:db8:3:4::192.0.2.33 64:ff9b::192.0.2.33 + echo "$RE_IPV6" +} + +get_ipv4_regex() { + local RE_IPV4="$(_ipv4_regex)" + # Ensure the ip address continues to the end of the line + # Fixes using a wildcard dns service such as xip.io which allows for *..xip.io + echo "${RE_IPV4}\$" +} + +get_ipv6_regex() { + local RE_IPV6="$(_ipv4_regex)" + # Ensure the ip address continues to the end of the line + # Fixes using a wildcard dns service such as xip.io which allows for *..xip.io + echo "${RE_IPV6}\$" +} + is_app_nginx_enabled() { local APP="$1" verify_app_name "$APP" @@ -22,26 +57,10 @@ is_global_vhost_enabled() { local GLOBAL_VHOST_ENABLED=true [[ -f "$GLOBAL_VHOST_FILE" ]] && local GLOBAL_VHOST=$(< "$GLOBAL_VHOST_FILE") - local RE_IPV4="([0-9]{1,3}[\.]){3}[0-9]{1,3}" - - local RE_IPV6="([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|" # TEST: 1:2:3:4:5:6:7:8 - local RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,7}:|" # TEST: 1:: 1:2:3:4:5:6:7:: - local RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|" # TEST: 1::8 1:2:3:4:5:6::8 1:2:3:4:5:6::8 - local RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|" # TEST: 1::7:8 1:2:3:4:5::7:8 1:2:3:4:5::8 - local RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|" # TEST: 1::6:7:8 1:2:3:4::6:7:8 1:2:3:4::8 - local RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|" # TEST: 1::5:6:7:8 1:2:3::5:6:7:8 1:2:3::8 - local RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|" # TEST: 1::4:5:6:7:8 1:2::4:5:6:7:8 1:2::8 - local RE_IPV6="${RE_IPV6}[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|" # TEST: 1::3:4:5:6:7:8 1::3:4:5:6:7:8 1::8 - local RE_IPV6="${RE_IPV6}:((:[0-9a-fA-F]{1,4}){1,7}|:)|" # TEST: ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 :: - local RE_IPV6="${RE_IPV6}fe08:(:[0-9a-fA-F]{1,4}){2,2}%[0-9a-zA-Z]{1,}|" # TEST: fe08::7:8%eth0 fe08::7:8%1 (link-local IPv6 addresses with zone index) - local RE_IPV6="${RE_IPV6}::(ffff(:0{1,4}){0,1}:){0,1}${RE_IPV4}|" # TEST: ::255.255.255.255 ::ffff:255.255.255.255 ::ffff:0:255.255.255.255 (IPv4-mapped IPv6 addresses and IPv4-translated addresses) - local RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,4}:${RE_IPV4}" # TEST: 2001:db8:3:4::192.0.2.33 64:ff9b::192.0.2.33 - - # Ensure the ip address continues to the end of the line # Fixes using a wildcard dns service such as xip.io which allows for *..xip.io - local RE_IPV4="${RE_IPV4}\$" - local RE_IPV6="${RE_IPV6}\$" + local RE_IPV4="$(get_ipv4_regex)" + local RE_IPV6="$(get_ipv6_regex)" if [[ -z "$GLOBAL_VHOST" ]] || [[ "$GLOBAL_VHOST" =~ $RE_IPV4 ]] || [[ "$GLOBAL_VHOST" =~ $RE_IPV6 ]]; then local GLOBAL_VHOST_ENABLED=false diff --git a/plugins/plugin/commands b/plugins/plugin/commands index 8df025c37..d4eb65327 100755 --- a/plugins/plugin/commands +++ b/plugins/plugin/commands @@ -1,4 +1,5 @@ #!/usr/bin/env bash +[[ " plugin plugin:install plugin:install-dependencies plugin:update plugin:disable plugin:enable plugin:uninstall help plugin:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/plugin/functions" diff --git a/plugins/ps/commands b/plugins/ps/commands index d9614c623..3e0a7357a 100755 --- a/plugins/ps/commands +++ b/plugins/ps/commands @@ -1,4 +1,5 @@ #!/usr/bin/env bash +[[ " ps ps:start ps:stop ps:rebuild ps:rebuildall ps:restart ps:restartall ps:scale help ps:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions" diff --git a/plugins/shell/commands b/plugins/shell/commands index f64e231aa..16fec26f4 100755 --- a/plugins/shell/commands +++ b/plugins/shell/commands @@ -1,4 +1,5 @@ #!/usr/bin/env bash +[[ " shell help shell:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x case "$1" in diff --git a/plugins/tags/commands b/plugins/tags/commands index 58061e835..9990485a9 100755 --- a/plugins/tags/commands +++ b/plugins/tags/commands @@ -1,4 +1,5 @@ #!/usr/bin/env bash +[[ " tags tags:create tags:deploy tags:destroy help tags:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/tags/functions" diff --git a/plugins/tar/commands b/plugins/tar/commands index 76da3766f..519ae4e15 100755 --- a/plugins/tar/commands +++ b/plugins/tar/commands @@ -1,4 +1,5 @@ #!/usr/bin/env bash +[[ " tar-from tar:from tar-in tar:in tar-build tar-build-locked help tar:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" @@ -57,7 +58,7 @@ case "$1" in fi ;; - help) + help | tar:help) cat && cat<, Reads an tarball containing the app from stdin tar:from , Loads an app tarball from url. diff --git a/tests/unit/config.bats b/tests/unit/config.bats index 10e1239d9..d32131403 100644 --- a/tests/unit/config.bats +++ b/tests/unit/config.bats @@ -77,7 +77,7 @@ teardown() { } @test "(config) config:unset" { - run ssh dokku@dokku.me config:set $TEST_APP test_var=true test_var2=\"hello world\" + run ssh dokku@dokku.me config:set $TEST_APP test_var=true test_var2=\"hello world\" test_var3=\"with\\nnewline\" echo "output: "$output echo "status: "$status assert_success @@ -93,6 +93,10 @@ teardown() { echo "output: "$output echo "status: "$status assert_output "" + run dokku config:get $TEST_APP test_var3 + echo "output: "$output + echo "status: "$status + assert_output 'with\nnewline' } @test "(config) global config (herokuish)" {