Skip to content

Commit

Permalink
Add init script for configuring datapusher
Browse files Browse the repository at this point in the history
As discussed in #95, depends on this one to be
merged/pushed first:

ckan/ckan-docker-base#32
  • Loading branch information
amercader committed Oct 17, 2023
1 parent 8cf41a2 commit e439eda
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 e439eda

Please sign in to comment.