From 40d9bbe925b8dc318765645c462e8efb3c756870 Mon Sep 17 00:00:00 2001 From: Lubomir Dolezal <lubomir.bucek@eox.at> Date: Fri, 5 Aug 2022 14:43:38 +0200 Subject: [PATCH] adapt development/debug in configure.sh for renderer --- Dockerfile | 2 +- configure.sh | 11 ++++++----- entrypoint.sh | 1 - registrar/cli.py | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 589bd5e..8a42a5e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -76,7 +76,7 @@ ENV INSTANCE_ID="view-server_core" \ GDAL_PAM_ENABLED="NO" \ OWS_WCS_MAXSIZE="4096" \ EOXS_LAYER_SUFFIX_SEPARATOR="__" \ - DEV="false" \ + DEVELOPMENT="false" \ ENABLE_HTTP_ACCESS="false" COPY . . diff --git a/configure.sh b/configure.sh index 4ec5171..f4c30e8 100755 --- a/configure.sh +++ b/configure.sh @@ -60,12 +60,11 @@ echo "ALLOWED_HOSTS = ['*']" >> pvs_instance/settings.py echo "USE_X_FORWARDED_HOST = True" >> pvs_instance/settings.py echo "SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')" >> pvs_instance/settings.py - if $DEV ; then + if $DEVELOPMENT ; then # activate django cors plugin for dev environment to remove need for browser cors plugin sed -i "s/ 'django.contrib.auth',/ 'corsheaders', 'django.contrib.auth',/g" pvs_instance/settings.py sed -i "s/ 'django.contrib.sessions.middleware.SessionMiddleware',/ 'corsheaders.middleware.CorsMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',/g" pvs_instance/settings.py echo 'CORS_ORIGIN_ALLOW_ALL = True' >> pvs_instance/settings.py - sed -e 's/DEBUG = False/DEBUG = True/' -i pvs_instance/settings.py fi @@ -86,11 +85,13 @@ if [[ "$EOXS_OPENSEARCH_GETCOVERAGE_HTML_EXCEPTION" = true ]] ; then echo "EOXS_OPENSEARCH_GETCOVERAGE_HTML_EXCEPTION = True" >> pvs_instance/settings.py fi - if [[ "$DEBUG" = true ]] ; then - echo "DEBUG ON Setting functions" - echo "MIDDLEWARE.append('pyinstrument.middleware.ProfilerMiddleware')" >> pvs_instance/settings.py sed -e 's/DEBUG = False/DEBUG = True/' -i pvs_instance/settings.py + fi + + if [[ "$DEVELOPMENT" = true ]] ; then + echo "DEVELOPMENT ON Setting functions" + echo "MIDDLEWARE.append('pyinstrument.middleware.ProfilerMiddleware')" >> pvs_instance/settings.py var="import os import sys diff --git a/entrypoint.sh b/entrypoint.sh index a259be0..9b366c3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,7 +4,6 @@ shopt -s nullglob SERVICES=${WAIT_SERVICES:=''} TIMEOUT=${WAIT_TIMEOUT:='15'} -DEBUG=${DEVELOPMENT:="false"} if [[ ! -z $SERVICES ]] ; then for service in $SERVICES ; do diff --git a/registrar/cli.py b/registrar/cli.py index cbe38f7..645ec9a 100644 --- a/registrar/cli.py +++ b/registrar/cli.py @@ -65,7 +65,7 @@ def setup_logging(debug=False): @click.option("--validate", is_flag=True) @click.option("--host", type=str) @click.option("--port", type=int) -@click.option("--debug", is_flag=True) +@click.option("--debug/--no-debug", is_flag=True) @click.pass_context def cli( ctx, config_file=None, validate=False, host=None, port=None, debug=False @@ -121,7 +121,7 @@ def daemon(ctx, replace=False): @cli.command(help="Run a single, one-off registration") @click.argument("route_name", type=str) @click.argument("item", type=str) -@click.option("--replace", is_flag=True) +@click.option("--replace/--no-replace", is_flag=True) @click.pass_context def register(ctx, route_name, item, replace): """ Registers a single item. -- GitLab