From e439eda620939709e38037a3dba295e991f1db5c Mon Sep 17 00:00:00 2001 From: amercader Date: Tue, 17 Oct 2023 13:06:48 +0200 Subject: [PATCH] Add init script for configuring datapusher As discussed in ckan/ckan-docker#95, depends on this one to be merged/pushed first: https://github.com/ckan/ckan-docker-base/pull/32 --- ckan/docker-entrypoint.d/01_setup_datapusher.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 ckan/docker-entrypoint.d/01_setup_datapusher.sh diff --git a/ckan/docker-entrypoint.d/01_setup_datapusher.sh b/ckan/docker-entrypoint.d/01_setup_datapusher.sh new file mode 100644 index 00000000..d119fb50 --- /dev/null +++ b/ckan/docker-entrypoint.d/01_setup_datapusher.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +if [[ $CKAN__PLUGINS == *"datapusher"* ]]; then + # Datapusher settings have been configured in the .env file + # Set API token if necessary + if [ -z "$CKAN__DATAPUSHER__API_TOKEN" ] ; then + echo "Set up ckan.datapusher.api_token in the CKAN config file" + ckan config-tool $CKAN_INI "ckan.datapusher.api_token=$(ckan -c $CKAN_INI user token add ckan_admin datapusher | tail -n 1 | tr -d '\t')" + fi +else + echo "Not configuring DataPusher" +fi