migrate env for NGINX_* to PROXY_*

This commit is contained in:
Alexis Tyler
2017-07-03 10:14:19 +09:30
committed by Jose Diaz-Gonzalez
parent 3d4d82ff4e
commit 7095eac052
4 changed files with 38 additions and 2 deletions

View File

@@ -348,3 +348,22 @@ nginx_build_config() {
fi
fi
}
# @TODO: Remove this after a few versions
migrate_nginx_to_proxy() {
declare desc="migrates DOKKU_NGINX_* to DOKKI_PROXY_*"
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
}