From 67979710165e29597a0bcd4d5516bb262cc5e73f Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 12 Mar 2019 12:08:15 -0400 Subject: [PATCH 1/6] chore: drop extra echo in app-json method calls --- plugins/app-json/internal-functions | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/app-json/internal-functions b/plugins/app-json/internal-functions index c6c3694d7..d4750b4ad 100755 --- a/plugins/app-json/internal-functions +++ b/plugins/app-json/internal-functions @@ -58,7 +58,6 @@ execute_script() { COMMAND+=" for file in /app/.profile.d/*; do source \$file; done ; " COMMAND+=" fi ; " COMMAND+=" if [[ -d '/cache' ]]; then " - COMMAND+=" echo restoring installation cache... ; " COMMAND+=" rm -rf /tmp/cache ; " COMMAND+=" ln -sf /cache /tmp/cache ; " COMMAND+=" fi ; " @@ -73,7 +72,6 @@ execute_script() { COMMAND+=" $SCRIPT_CMD || exit 1;" COMMAND+=" if [[ -d '/cache' ]]; then " - COMMAND+=" echo removing installation cache... ; " COMMAND+=" rm -f /tmp/cache ; " COMMAND+=" fi ; " From 7f1fe3ccfd8521539386f7d7d67f65935fae5e32 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 12 Mar 2019 12:34:45 -0400 Subject: [PATCH 2/6] chore: follow logging pattern from heroku for phase command declarations --- plugins/app-json/internal-functions | 2 +- plugins/common/functions | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/app-json/internal-functions b/plugins/app-json/internal-functions index d4750b4ad..37599fbf0 100755 --- a/plugins/app-json/internal-functions +++ b/plugins/app-json/internal-functions @@ -47,7 +47,7 @@ execute_script() { return fi - dokku_log_info1 "Running '$SCRIPT_CMD' in app container" + dokku_log_exclaim "${PHASE_SCRIPT_KEY^} command declared: '$SCRIPT_CMD'" local COMMAND COMMAND="set -eo pipefail; [[ \$DOKKU_TRACE ]] && set -x ; " COMMAND+=" if [[ -d '/app' ]]; then " diff --git a/plugins/common/functions b/plugins/common/functions index 72d0a95ec..749ed0cc1 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -96,6 +96,18 @@ dokku_log_verbose() { echo " $*" } +dokku_log_exclaim_quiet() { + declare desc="log exclaim formatter" + if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then + echo " ! $*" + fi +} + +dokku_log_exclaim() { + declare desc="log exclaim formatter" + echo " ! $*" +} + dokku_log_warn_quiet() { declare desc="log warning formatter" if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then From c701429a05d3f1ae4aadf5a16d891f522c4e805f Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 12 Mar 2019 12:35:36 -0400 Subject: [PATCH 3/6] chore: quiet down logging around scale declarations --- plugins/ps/functions | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/plugins/ps/functions b/plugins/ps/functions index 7d3a7c196..1738cf272 100755 --- a/plugins/ps/functions +++ b/plugins/ps/functions @@ -19,9 +19,7 @@ print_dokku_scale_file() { declare desc="prints contents of DOKKU_SCALE file" local APP="$1" local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE" - while read -r line || [[ -n "$line" ]]; do - dokku_log_info2_quiet "$line" - done <"$DOKKU_SCALE_FILE" + dokku_log_verbose_quiet "DOKKU_SCALE declares scale -> $(cat "$DOKKU_SCALE_FILE" | xargs)" } extract_procfile() { @@ -84,9 +82,6 @@ generate_scale_file() { else echo "web=1" >>"$DOKKU_SCALE_FILE" fi - dokku_log_info1_quiet "New DOKKU_SCALE file generated" - else - dokku_log_info1_quiet "DOKKU_SCALE file found ($DOKKU_SCALE_FILE)" fi print_dokku_scale_file "$APP" } From c6a1c0dcbfbd27990a515f13bceca05b3e4d3f85 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 12 Mar 2019 21:07:58 -0400 Subject: [PATCH 4/6] feat: respect --quiet in config.go When setting environment variables, we should respect a passed `--quiet` flag - and the respective environment variable. This will allow users to have a nicer experience when using the config functions within their own plugins. --- plugins/config/config.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/config/config.go b/plugins/config/config.go index 5f46992dd..23a74943a 100644 --- a/plugins/config/config.go +++ b/plugins/config/config.go @@ -2,6 +2,7 @@ package config import ( "fmt" + "os" "regexp" "github.com/dokku/dokku/plugins/common" @@ -46,8 +47,10 @@ func SetMany(appName string, entries map[string]string, restart bool) (err error keys = append(keys, k) } if len(entries) != 0 { - common.LogInfo1("Setting config vars") - fmt.Println(prettyPrintEnvEntries(" ", entries)) + common.LogInfo1Quiet("Setting config vars") + if os.Getenv("DOKKU_QUIET_OUTPUT") == "" { + fmt.Println(prettyPrintEnvEntries(" ", entries)) + } env.Write() triggerUpdate(appName, "set", keys) } @@ -72,11 +75,11 @@ func UnsetMany(appName string, keys []string, restart bool) (err error) { } for _, k := range keys { if _, hasKey := env.Map()[k]; hasKey { - common.LogInfo1(fmt.Sprintf("Unsetting %s", k)) + common.LogInfo1Quiet(fmt.Sprintf("Unsetting %s", k)) env.Unset(k) changed = true } else { - common.LogInfo1(fmt.Sprintf("Skipping %s, it is not set in the environment", k)) + common.LogInfo1Quiet(fmt.Sprintf("Skipping %s, it is not set in the environment", k)) } } if changed { From ef5a45c7cb1cff5e4766e4b574e0527dd0fc54c6 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 12 Mar 2019 21:08:47 -0400 Subject: [PATCH 5/6] feat: add DOKKU_QUIET_OUTPUT=1 to all config_set/config_unset calls This makes build output a bit more digestable. --- plugins/checks/install | 10 +++++----- plugins/checks/subcommands/disable | 12 ++++++------ plugins/checks/subcommands/enable | 12 ++++++------ plugins/checks/subcommands/skip | 12 ++++++------ plugins/common/functions | 2 +- plugins/domains/functions | 4 ++-- plugins/git/functions | 2 +- plugins/git/install | 4 ++-- plugins/nginx-vhosts/functions | 6 +++--- plugins/nginx-vhosts/install | 8 ++++---- plugins/nginx-vhosts/post-certs-update | 4 ++-- plugins/nginx-vhosts/pre-disable-vhost | 2 +- plugins/nginx-vhosts/pre-enable-vhost | 2 +- plugins/proxy/functions | 8 ++++---- plugins/proxy/post-certs-remove | 2 +- plugins/proxy/subcommands/disable | 2 +- plugins/proxy/subcommands/enable | 2 +- plugins/proxy/subcommands/ports-clear | 2 +- plugins/proxy/subcommands/set | 2 +- plugins/ps/core-post-deploy | 2 +- plugins/ps/post-stop | 2 +- 21 files changed, 51 insertions(+), 51 deletions(-) diff --git a/plugins/checks/install b/plugins/checks/install index b6ea729ec..48ec06086 100755 --- a/plugins/checks/install +++ b/plugins/checks/install @@ -22,16 +22,16 @@ migrate_checks_vars_0_5_0() { dokku_log_info2 "Please use dokku checks:[disable|enable] to control zero downtime functionality" dokku_log_info2 "" dokku_log_info2 "zero downtime checks disabled for app ($app)" - config_set --no-restart "$app" DOKKU_CHECKS_ENABLED=0 + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$app" DOKKU_CHECKS_ENABLED=0 fi if [[ -n "$APP_SKIP_ALL_CHECKS" ]] || [[ -n "$APP_SKIP_DEFAULT_CHECKS" ]]; then - config_unset --no-restart "$app" DOKKU_SKIP_ALL_CHECKS DOKKU_SKIP_DEFAULT_CHECKS + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$app" DOKKU_SKIP_ALL_CHECKS DOKKU_SKIP_DEFAULT_CHECKS fi done if [[ -n "$GLOBAL_SKIP_ALL_CHECKS" ]] || [[ -n "$GLOBAL_SKIP_DEFAULT_CHECKS" ]]; then dokku_log_info1 "Removing global zero downtime settings" - config_unset --global DOKKU_SKIP_ALL_CHECKS DOKKU_SKIP_DEFAULT_CHECKS + DOKKU_QUIET_OUTPUT=1 config_unset --global DOKKU_SKIP_ALL_CHECKS DOKKU_SKIP_DEFAULT_CHECKS fi } @@ -49,9 +49,9 @@ migrate_checks_vars_0_6_0() { if [[ "$APP_DOKKU_CHECKS_ENABLED" == "0" ]]; then dokku_log_info2 "" dokku_log_info2 "zero downtime checks disabled for app ($app)" - config_set --no-restart "$app" DOKKU_CHECKS_SKIPPED="_all_" + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$app" DOKKU_CHECKS_SKIPPED="_all_" fi - config_unset --no-restart "$app" DOKKU_CHECKS_ENABLED || true + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$app" DOKKU_CHECKS_ENABLED || true fi done } diff --git a/plugins/checks/subcommands/disable b/plugins/checks/subcommands/disable index 40e260bd8..0ae59bba7 100755 --- a/plugins/checks/subcommands/disable +++ b/plugins/checks/subcommands/disable @@ -16,8 +16,8 @@ checks_disable_cmd() { if [[ "$PROCTYPES" == "_all_" ]]; then dokku_log_info1 "Disabling zero downtime for app ($APP)" - config_set --no-restart "$APP" DOKKU_CHECKS_DISABLED="$PROCTYPES" - config_unset --no-restart "$APP" DOKKU_CHECKS_SKIPPED + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_CHECKS_DISABLED="$PROCTYPES" + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$APP" DOKKU_CHECKS_SKIPPED else dokku_log_info1 "Disabling zero downtime for app's ($APP) proctypes ($PROCTYPES)" local PROCTYPE OIFS="$IFS" IFS=, @@ -30,15 +30,15 @@ checks_disable_cmd() { done DOKKU_CHECKS_DISABLED="$(remove_val_from_list "_all_" "$DOKKU_CHECKS_DISABLED")" if [[ -z "$DOKKU_CHECKS_DISABLED" ]]; then - config_unset --no-restart "$APP" DOKKU_CHECKS_DISABLED + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$APP" DOKKU_CHECKS_DISABLED else - config_set --no-restart "$APP" DOKKU_CHECKS_DISABLED="$DOKKU_CHECKS_DISABLED" + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_CHECKS_DISABLED="$DOKKU_CHECKS_DISABLED" fi if [[ -z "$DOKKU_CHECKS_SKIPPED" ]]; then - config_unset --no-restart "$APP" DOKKU_CHECKS_SKIPPED + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$APP" DOKKU_CHECKS_SKIPPED else - config_set --no-restart "$APP" DOKKU_CHECKS_SKIPPED="$DOKKU_CHECKS_SKIPPED" + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_CHECKS_SKIPPED="$DOKKU_CHECKS_SKIPPED" fi fi } diff --git a/plugins/checks/subcommands/enable b/plugins/checks/subcommands/enable index 659d3b35f..59e2974b9 100755 --- a/plugins/checks/subcommands/enable +++ b/plugins/checks/subcommands/enable @@ -17,8 +17,8 @@ checks_enable_cmd() { if [[ "$PROCTYPES" == "_all_" ]]; then dokku_log_info1 "Enabling zero downtime for app's ($APP)" - config_unset --no-restart "$APP" DOKKU_CHECKS_DISABLED - config_unset --no-restart "$APP" DOKKU_CHECKS_SKIPPED + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$APP" DOKKU_CHECKS_DISABLED + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$APP" DOKKU_CHECKS_SKIPPED else dokku_log_info1 "Enabling zero downtime for app's ($APP) proctypes ($PROCTYPES)" local PROCTYPE OIFS="$IFS" IFS=, @@ -29,15 +29,15 @@ checks_enable_cmd() { IFS="$OIFS" if [[ -z "$DOKKU_CHECKS_DISABLED" ]]; then - config_unset --no-restart "$APP" DOKKU_CHECKS_DISABLED + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$APP" DOKKU_CHECKS_DISABLED else - config_set --no-restart "$APP" DOKKU_CHECKS_DISABLED="$DOKKU_CHECKS_DISABLED" + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_CHECKS_DISABLED="$DOKKU_CHECKS_DISABLED" fi if [[ -z "$DOKKU_CHECKS_SKIPPED" ]]; then - config_unset --no-restart "$APP" DOKKU_CHECKS_SKIPPED + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$APP" DOKKU_CHECKS_SKIPPED else - config_set --no-restart "$APP" DOKKU_CHECKS_SKIPPED="$DOKKU_CHECKS_SKIPPED" + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_CHECKS_SKIPPED="$DOKKU_CHECKS_SKIPPED" fi fi } diff --git a/plugins/checks/subcommands/skip b/plugins/checks/subcommands/skip index 05a543cb3..169307c8c 100755 --- a/plugins/checks/subcommands/skip +++ b/plugins/checks/subcommands/skip @@ -16,8 +16,8 @@ checks_skip_cmd() { if [[ "$PROCTYPES" == "_all_" ]]; then dokku_log_info1 "Skipping zero downtime for app ($APP)" - config_set --no-restart "$APP" DOKKU_CHECKS_SKIPPED="$PROCTYPES" - config_unset --no-restart "$APP" DOKKU_CHECKS_DISABLED + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_CHECKS_SKIPPED="$PROCTYPES" + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$APP" DOKKU_CHECKS_DISABLED else dokku_log_info1 "Skipping zero downtime for app's ($APP) proctypes ($PROCTYPES)" local PROCTYPE OIFS="$IFS" IFS=, @@ -30,15 +30,15 @@ checks_skip_cmd() { done DOKKU_CHECKS_SKIPPED="$(remove_val_from_list "_all_" "$DOKKU_CHECKS_SKIPPED")" if [[ -z "$DOKKU_CHECKS_DISABLED" ]]; then - config_unset --no-restart "$APP" DOKKU_CHECKS_DISABLED + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$APP" DOKKU_CHECKS_DISABLED else - config_set --no-restart "$APP" DOKKU_CHECKS_DISABLED="$DOKKU_CHECKS_DISABLED" + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_CHECKS_DISABLED="$DOKKU_CHECKS_DISABLED" fi if [[ -z "$DOKKU_CHECKS_SKIPPED" ]]; then - config_unset --no-restart "$APP" DOKKU_CHECKS_SKIPPED + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$APP" DOKKU_CHECKS_SKIPPED else - config_set --no-restart "$APP" DOKKU_CHECKS_SKIPPED="$DOKKU_CHECKS_SKIPPED" + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_CHECKS_SKIPPED="$DOKKU_CHECKS_SKIPPED" fi fi } diff --git a/plugins/common/functions b/plugins/common/functions index 749ed0cc1..0cf7fc690 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -678,7 +678,7 @@ dokku_receive() { local DOKKU_SKIP_CLEANUP="$(config_get "$APP" DOKKU_SKIP_CLEANUP || true)" docker_cleanup "$APP" dokku_log_info1 "Building $APP from $IMAGE_SOURCE_TYPE..." - config_set --no-restart "$APP" DOKKU_APP_TYPE="$IMAGE_SOURCE_TYPE" &>/dev/null + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_APP_TYPE="$IMAGE_SOURCE_TYPE" dokku_build "$APP" "$IMAGE_SOURCE_TYPE" "$TMP_WORK_DIR" release_and_deploy "$APP" } diff --git a/plugins/domains/functions b/plugins/domains/functions index bc9545a8e..97e166ada 100755 --- a/plugins/domains/functions +++ b/plugins/domains/functions @@ -24,7 +24,7 @@ disable_app_vhost() { [[ "$2" == "--no-restart" ]] && local CONFIG_SET_ARGS=$2 # shellcheck disable=SC2086 - config_set $CONFIG_SET_ARGS $APP NO_VHOST=1 + DOKKU_QUIET_OUTPUT=1 config_set $CONFIG_SET_ARGS $APP NO_VHOST=1 } domains_setup() { @@ -212,7 +212,7 @@ enable_app_vhost() { plugn trigger pre-enable-vhost "$APP" [[ "$2" == "--no-restart" ]] && local CONFIG_SET_ARGS=$2 # shellcheck disable=SC2086 - config_set $CONFIG_SET_ARGS "$APP" NO_VHOST=0 + DOKKU_QUIET_OUTPUT=1 config_set $CONFIG_SET_ARGS "$APP" NO_VHOST=0 } get_app_domains() { diff --git a/plugins/git/functions b/plugins/git/functions index c84821477..922f2d4ea 100755 --- a/plugins/git/functions +++ b/plugins/git/functions @@ -165,7 +165,7 @@ git_build() { fi if [[ -n "$ENV_VAR_NAME" ]]; then - config_set --no-restart "$APP" "${ENV_VAR_NAME}=${REV}" >/dev/null + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" "${ENV_VAR_NAME}=${REV}" fi local REF="$REV" else diff --git a/plugins/git/install b/plugins/git/install index 75906f2e6..01f38de3b 100755 --- a/plugins/git/install +++ b/plugins/git/install @@ -18,14 +18,14 @@ migrate_git_vars_0_12_0() { DOKKU_DEPLOY_BRANCH=$(config_get --global DOKKU_DEPLOY_BRANCH || true) if [[ -n "$DOKKU_DEPLOY_BRANCH" ]]; then fn-plugin-property-write "git" --global "deploy-branch" "$DOKKU_DEPLOY_BRANCH" - config_unset --global DOKKU_DEPLOY_BRANCH || true + DOKKU_QUIET_OUTPUT=1 config_unset --global DOKKU_DEPLOY_BRANCH || true fi for app in $APPS; do DOKKU_DEPLOY_BRANCH=$(config_get "$app" DOKKU_DEPLOY_BRANCH || true) if [[ -n "$DOKKU_DEPLOY_BRANCH" ]]; then fn-plugin-property-write "git" "$app" "deploy-branch" "$DOKKU_DEPLOY_BRANCH" - config_unset --no-restart "$app" DOKKU_DEPLOY_BRANCH || true + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$app" DOKKU_DEPLOY_BRANCH || true fi done } diff --git a/plugins/nginx-vhosts/functions b/plugins/nginx-vhosts/functions index 661e7ed9c..7d3a15ea7 100755 --- a/plugins/nginx-vhosts/functions +++ b/plugins/nginx-vhosts/functions @@ -123,7 +123,7 @@ configure_nginx_ports() { else local PROXY_PORT=80 fi - config_set --no-restart "$APP" DOKKU_PROXY_PORT="$PROXY_PORT" + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_PROXY_PORT="$PROXY_PORT" fi if [[ -z "$DOKKU_PROXY_SSL_PORT" ]]; then if (is_ssl_enabled "$APP"); then @@ -132,7 +132,7 @@ configure_nginx_ports() { dokku_log_info1 "no proxy ssl port set. setting to random open high port" PROXY_SSL_PORT=$(get_available_port) fi - config_set --no-restart "$APP" DOKKU_PROXY_SSL_PORT="$PROXY_SSL_PORT" + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_PROXY_SSL_PORT="$PROXY_SSL_PORT" fi fi if [[ -z "$DOKKU_PROXY_PORT_MAP" ]]; then @@ -154,7 +154,7 @@ configure_nginx_ports() { if [[ -n "$PROXY_PORT_MAP" ]]; then local PROXY_PORT_MAP="$(echo "$PROXY_PORT_MAP" | xargs)" local PROXY_PORT_MAP+=" $(merge_dedupe_list "$(remove_val_from_list "$PORT_MAP" "$DOKKU_PROXY_PORT_MAP" " ")" " ") " - config_set --no-restart "$APP" DOKKU_PROXY_PORT_MAP="$PROXY_PORT_MAP" + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_PROXY_PORT_MAP="$PROXY_PORT_MAP" fi fi } diff --git a/plugins/nginx-vhosts/install b/plugins/nginx-vhosts/install index 26bfcfe41..c48e451b0 100755 --- a/plugins/nginx-vhosts/install +++ b/plugins/nginx-vhosts/install @@ -83,13 +83,13 @@ for app in $(dokku_apps); do fi if [[ -n "$nginx_port" ]]; then dokku_log_info1 "Migrating DOKKU_NGINX_PORT to DOKKU_PROXY_PORT for $app" - config_set --no-restart "$app" DOKKU_PROXY_PORT="$nginx_port" - config_unset --no-restart "$app" DOKKU_NGINX_PORT + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$app" DOKKU_PROXY_PORT="$nginx_port" + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$app" DOKKU_NGINX_PORT fi if [[ -n "$nginx_ssl_port" ]]; then dokku_log_info1 "Migrating DOKKU_NGINX_SSL_PORT to DOKKU_PROXY_SSL_PORT for $app" - config_set --no-restart "$app" DOKKU_PROXY_SSL_PORT="$nginx_ssl_port" - config_unset --no-restart "$app" DOKKU_NGINX_SSL_PORT + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$app" DOKKU_PROXY_SSL_PORT="$nginx_ssl_port" + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$app" DOKKU_NGINX_SSL_PORT fi done diff --git a/plugins/nginx-vhosts/post-certs-update b/plugins/nginx-vhosts/post-certs-update index 64635493c..936bc7135 100755 --- a/plugins/nginx-vhosts/post-certs-update +++ b/plugins/nginx-vhosts/post-certs-update @@ -15,10 +15,10 @@ nginx_post_certs_update() { local DOKKU_PROXY_PORT_MAP=$(config_get "$APP" DOKKU_PROXY_PORT_MAP) if [[ "$DOKKU_PROXY_PORT" == "80" ]]; then - config_unset --no-restart "$APP" DOKKU_PROXY_PORT + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$APP" DOKKU_PROXY_PORT fi if [[ "$DOKKU_PROXY_SSL_PORT" == "443" ]]; then - config_unset --no-restart "$APP" DOKKU_PROXY_SSL_PORT + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$APP" DOKKU_PROXY_SSL_PORT fi if [[ "$DOKKU_PROXY_PORT_MAP" == *http:80:* ]]; then # shellcheck disable=SC2046 diff --git a/plugins/nginx-vhosts/pre-disable-vhost b/plugins/nginx-vhosts/pre-disable-vhost index 7ca7cafe2..8c2244f23 100755 --- a/plugins/nginx-vhosts/pre-disable-vhost +++ b/plugins/nginx-vhosts/pre-disable-vhost @@ -10,7 +10,7 @@ nginx_pre_disable_vhost_trigger() { local trigger="nginx_pre_disable_vhost_trigger" local APP="$1" if [[ "$(get_app_proxy_type "$APP")" == "nginx" ]]; then - config_unset --no-restart "$APP" DOKKU_PROXY_PORT DOKKU_PROXY_SSL_PORT DOKKU_PROXY_PORT_MAP + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$APP" DOKKU_PROXY_PORT DOKKU_PROXY_SSL_PORT DOKKU_PROXY_PORT_MAP fi } diff --git a/plugins/nginx-vhosts/pre-enable-vhost b/plugins/nginx-vhosts/pre-enable-vhost index eb6d26d58..2cec7b511 100755 --- a/plugins/nginx-vhosts/pre-enable-vhost +++ b/plugins/nginx-vhosts/pre-enable-vhost @@ -10,7 +10,7 @@ nginx_pre_enable_vhost_trigger() { local trigger="nginx_pre_enable_vhost_trigger" local APP="$1" if [[ "$(get_app_proxy_type "$APP")" == "nginx" ]]; then - config_unset --no-restart "$APP" DOKKU_PROXY_PORT DOKKU_PROXY_SSL_PORT DOKKU_PROXY_PORT_MAP + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$APP" DOKKU_PROXY_PORT DOKKU_PROXY_SSL_PORT DOKKU_PROXY_PORT_MAP fi } diff --git a/plugins/proxy/functions b/plugins/proxy/functions index 10fd1588a..206e12719 100755 --- a/plugins/proxy/functions +++ b/plugins/proxy/functions @@ -80,7 +80,7 @@ add_proxy_ports() { local INPUT_PORTS="$*" if [[ -n "$INPUT_PORTS" ]]; then PROXY_PORT_MAP="$(merge_dedupe_list "$PROXY_PORT_MAP $INPUT_PORTS" " ")" - config_set --no-restart "$APP" DOKKU_PROXY_PORT_MAP="$PROXY_PORT_MAP" + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_PROXY_PORT_MAP="$PROXY_PORT_MAP" else dokku proxy:help dokku_log_fail "No port mapping specified. Exiting..." @@ -107,9 +107,9 @@ remove_proxy_ports() { PROXY_PORT_MAP="$(echo "$PROXY_PORT_MAP" | xargs)" PROXY_PORT_MAP="$(merge_dedupe_list "$PROXY_PORT_MAP" " ")" if [[ -n "$PROXY_PORT_MAP" ]]; then - config_set --no-restart "$APP" DOKKU_PROXY_PORT_MAP="$PROXY_PORT_MAP" + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_PROXY_PORT_MAP="$PROXY_PORT_MAP" else - config_unset --no-restart "$APP" DOKKU_PROXY_PORT_MAP + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$APP" DOKKU_PROXY_PORT_MAP fi } @@ -121,7 +121,7 @@ set_proxy_ports() { local INPUT_PORTS="$*" if [[ -n "$INPUT_PORTS" ]]; then PROXY_PORT_MAP="$(merge_dedupe_list "$INPUT_PORTS" " ")" - config_set --no-restart "$APP" DOKKU_PROXY_PORT_MAP="$PROXY_PORT_MAP" + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_PROXY_PORT_MAP="$PROXY_PORT_MAP" else dokku proxy:help dokku_log_fail "No port mapping specified. Exiting..." diff --git a/plugins/proxy/post-certs-remove b/plugins/proxy/post-certs-remove index d24c947a6..426dd03c3 100755 --- a/plugins/proxy/post-certs-remove +++ b/plugins/proxy/post-certs-remove @@ -10,7 +10,7 @@ trigger-proxy-post-certs-remove() { local trigger="nginx_post_certs_remove" local APP="$1" - config_unset --no-restart "$APP" DOKKU_PROXY_SSL_PORT + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$APP" DOKKU_PROXY_SSL_PORT # shellcheck disable=SC2046 remove_proxy_ports "$APP" $(filter_app_proxy_ports "$APP" "https" "443") diff --git a/plugins/proxy/subcommands/disable b/plugins/proxy/subcommands/disable index 39bb688cf..16eaee88e 100755 --- a/plugins/proxy/subcommands/disable +++ b/plugins/proxy/subcommands/disable @@ -16,7 +16,7 @@ proxy_disable_cmd() { dokku_log_info1 "Disabling proxy for app ($APP)" [[ "$2" == "--no-restart" ]] && local CONFIG_SET_ARGS=$2 # shellcheck disable=SC2086 - config_set $CONFIG_SET_ARGS $APP DOKKU_DISABLE_PROXY=1 + DOKKU_QUIET_OUTPUT=1 config_set $CONFIG_SET_ARGS $APP DOKKU_DISABLE_PROXY=1 plugn trigger proxy-disable "$APP" else dokku_log_info1 "proxy is already disable for app ($APP)" diff --git a/plugins/proxy/subcommands/enable b/plugins/proxy/subcommands/enable index 23d0e66cc..999964dbf 100755 --- a/plugins/proxy/subcommands/enable +++ b/plugins/proxy/subcommands/enable @@ -16,7 +16,7 @@ proxy_enable_cmd() { dokku_log_info1 "Enabling proxy for app ($APP)" [[ "$2" == "--no-restart" ]] && local CONFIG_SET_ARGS=$2 # shellcheck disable=SC2086 - config_unset $CONFIG_SET_ARGS $APP DOKKU_DISABLE_PROXY + DOKKU_QUIET_OUTPUT=1 config_unset $CONFIG_SET_ARGS $APP DOKKU_DISABLE_PROXY plugn trigger proxy-enable "$APP" else dokku_log_info1 "proxy is already enabled for app ($APP)" diff --git a/plugins/proxy/subcommands/ports-clear b/plugins/proxy/subcommands/ports-clear index 591d1f22e..38af7c0c4 100755 --- a/plugins/proxy/subcommands/ports-clear +++ b/plugins/proxy/subcommands/ports-clear @@ -10,7 +10,7 @@ proxy_ports_clear_cmd() { local APP="$2" verify_app_name "$APP" - config_unset --no-restart "$APP" DOKKU_PROXY_PORT_MAP + DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$APP" DOKKU_PROXY_PORT_MAP plugn trigger post-proxy-ports-update "$APP" "clear" } diff --git a/plugins/proxy/subcommands/set b/plugins/proxy/subcommands/set index 9132ddb28..ab59a3ab1 100755 --- a/plugins/proxy/subcommands/set +++ b/plugins/proxy/subcommands/set @@ -14,7 +14,7 @@ proxy_set_cmd() { local PROXY_TYPE="$3" if [[ -n "$PROXY_TYPE" ]]; then - config_set --no-restart "$APP" DOKKU_APP_PROXY_TYPE="$PROXY_TYPE" + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_APP_PROXY_TYPE="$PROXY_TYPE" else dokku_log_fail "Please specify a proxy type!" fi diff --git a/plugins/ps/core-post-deploy b/plugins/ps/core-post-deploy index 0785b90e7..51e87263d 100755 --- a/plugins/ps/core-post-deploy +++ b/plugins/ps/core-post-deploy @@ -11,7 +11,7 @@ ps_core_post_deploy() { local APP="$1" remove_procfile "$APP" - config_set --no-restart "$APP" DOKKU_APP_RESTORE=1 + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_APP_RESTORE=1 } ps_core_post_deploy "$@" diff --git a/plugins/ps/post-stop b/plugins/ps/post-stop index b9b8a4567..0dd4c91d2 100755 --- a/plugins/ps/post-stop +++ b/plugins/ps/post-stop @@ -10,7 +10,7 @@ ps_post_stop() { local trigger="ps_post_stop" local APP="$1" - config_set --no-restart "$APP" DOKKU_APP_RESTORE=0 + DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_APP_RESTORE=0 } ps_post_stop "$@" From 520a72078e8554d18a7fc21eb030c8aed6554540 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 13 Mar 2019 14:12:35 -0400 Subject: [PATCH 6/6] fix: remove useless cat --- plugins/ps/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ps/functions b/plugins/ps/functions index 1738cf272..f217e6f0d 100755 --- a/plugins/ps/functions +++ b/plugins/ps/functions @@ -19,7 +19,7 @@ print_dokku_scale_file() { declare desc="prints contents of DOKKU_SCALE file" local APP="$1" local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE" - dokku_log_verbose_quiet "DOKKU_SCALE declares scale -> $(cat "$DOKKU_SCALE_FILE" | xargs)" + dokku_log_verbose_quiet "DOKKU_SCALE declares scale -> $(xargs <"$DOKKU_SCALE_FILE")" } extract_procfile() {