From dc0404dbf149de086da4e0dfed55b497e65208fc Mon Sep 17 00:00:00 2001 From: Alexis Tyler Date: Mon, 3 Jul 2017 11:54:28 +0930 Subject: [PATCH] add better logging to nginx migrate and fix indentation --- plugins/nginx-vhosts/functions | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/plugins/nginx-vhosts/functions b/plugins/nginx-vhosts/functions index b40863375..9050ab631 100755 --- a/plugins/nginx-vhosts/functions +++ b/plugins/nginx-vhosts/functions @@ -354,18 +354,22 @@ nginx_build_config() { # @TODO: Remove this after a few versions migrate_nginx_to_proxy() { declare desc="migrates DOKKU_NGINX_* to DOKKI_PROXY_*" + dokku_log_info1 "Migrating DOKKU_NGINX env variables. The following variables will be migrated" + dokku_log_info2 "DOKKU_NGINX_PORT -> DOKKU_PROXY_PORT" + dokku_log_info2 "DOKKU_NGINX_SSL_PORT -> DOKKU_PROXY_SSL_PORT" for app in $(dokku_apps); do local nginx_port="$(config_get "$app" DOKKU_NGINX_PORT || true)" local nginx_ssl_port="$(config_get "$app" DOKKU_NGINX_SSL_PORT || true)" - 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 - 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 - fi - done + 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 + 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 + fi + done + dokku_log_info2 "Migration complete" }