From 36d8342bccd9a788d42a43e39a41060456d4078b Mon Sep 17 00:00:00 2001 From: Abraham Toriz Date: Mon, 18 Apr 2022 12:55:42 +0800 Subject: [PATCH] allow override of config file --- README.md | 6 +++++- deployment/datapusher.wsgi | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c55cdc6..f305bb0 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,11 @@ integation. Please refer to the [DataPusher Settings](https://docs.ckan.org/en/l ### DataPusher Configuration -The DataPusher instance is configured in the `deployment/datapusher_settings.py` file. +The DataPusher instance is configured in the `deployment/datapusher_settings.py` +file. The location of this file can be adjusted using the `JOB_CONFIG` +environment variable which should provide an absolute path to a python-formatted +config file. + Here's a summary of the options available. | Name | Default | Description | diff --git a/deployment/datapusher.wsgi b/deployment/datapusher.wsgi index 8b13122..ea67d57 100644 --- a/deployment/datapusher.wsgi +++ b/deployment/datapusher.wsgi @@ -4,7 +4,8 @@ import ckanserviceprovider.web as web config_filepath = os.path.join( os.path.dirname(os.path.abspath(__file__)), 'datapusher_settings.py') -os.environ['JOB_CONFIG'] = config_filepath +if 'JOB_CONFIG' not in os.environ: + os.environ['JOB_CONFIG'] = config_filepath web.init()