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
This commit is contained in:
amercader 2023-10-17 13:06:48 +02:00
parent 8cf41a2ee2
commit e439eda620
1 changed files with 12 additions and 0 deletions

View File

@ -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