Skip to content

Commit

Permalink
Merge pull request ckan#97 from ckan/datapusher-init
Browse files Browse the repository at this point in the history
Add init script for configuring datapusher
  • Loading branch information
kowh-ai authored Oct 19, 2023
2 parents f42b80d + e439eda commit b48be97
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ckan/docker-entrypoint.d/01_setup_datapusher.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b48be97

Please sign in to comment.