Merge pull request #97 from ckan/datapusher-init

Add init script for configuring datapusher
This commit is contained in:
Brett Jones 2023-10-19 10:01:29 +02:00 committed by GitHub
commit b48be9783f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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