diff --git a/images/ckan/2.7/Dockerfile b/images/ckan/2.7/Dockerfile index ec72633..fecaf1e 100644 --- a/images/ckan/2.7/Dockerfile +++ b/images/ckan/2.7/Dockerfile @@ -166,6 +166,9 @@ RUN rm -rf /srv/app/wheels /srv/app/ext_wheels # Copy necessary scripts COPY setup/app ${APP_DIR} +# Copy the alias script for paster to be ckan so it's compatible with 2.9 +COPY setup/bin/ckan /usr/bin/ckan + # Create entrypoint directory for children image scripts ONBUILD RUN mkdir docker-entrypoint.d diff --git a/images/ckan/2.7/setup/bin/ckan b/images/ckan/2.7/setup/bin/ckan new file mode 100755 index 0000000..0389541 --- /dev/null +++ b/images/ckan/2.7/setup/bin/ckan @@ -0,0 +1,14 @@ +#!/bin/bash +# CKAN <2.9 uses paster and the ckan plugin for paster which expects the configuration to be passed +# to a subcommand, example: paster --plugin=ckan datastore -c /srv/app/production.ini set-permissions +# CKAN >2.9 ckan CLI command expects the configuration option as the second and third parameter +# Example: ckan -c /srv/app/production.ini datastore set-permissions +# +# Shift the two arguments so that we can move them to the end of the argument list +# ckan -c /srv/app/production.ini datastore set-permissions +# becomes +# paster --plugin datastore set-permissions -c /srv/app/production.ini +config_switch=$1 +config_file=$2 +shift 2 +paster --plugin=ckan "$@" "$config_switch" "$config_file" diff --git a/images/ckan/2.8/Dockerfile b/images/ckan/2.8/Dockerfile index a7d9e24..4ec6e6c 100644 --- a/images/ckan/2.8/Dockerfile +++ b/images/ckan/2.8/Dockerfile @@ -160,6 +160,9 @@ RUN rm -rf /srv/app/wheels /srv/app/ext_wheels # Copy necessary scripts COPY setup/app ${APP_DIR} +# Copy the alias script for paster to be ckan so it's compatible with 2.9 +COPY setup/bin/ckan /usr/bin/ckan + # Create entrypoint directory for children image scripts ONBUILD RUN mkdir docker-entrypoint.d diff --git a/images/ckan/2.8/setup/bin/ckan b/images/ckan/2.8/setup/bin/ckan new file mode 100755 index 0000000..0389541 --- /dev/null +++ b/images/ckan/2.8/setup/bin/ckan @@ -0,0 +1,14 @@ +#!/bin/bash +# CKAN <2.9 uses paster and the ckan plugin for paster which expects the configuration to be passed +# to a subcommand, example: paster --plugin=ckan datastore -c /srv/app/production.ini set-permissions +# CKAN >2.9 ckan CLI command expects the configuration option as the second and third parameter +# Example: ckan -c /srv/app/production.ini datastore set-permissions +# +# Shift the two arguments so that we can move them to the end of the argument list +# ckan -c /srv/app/production.ini datastore set-permissions +# becomes +# paster --plugin datastore set-permissions -c /srv/app/production.ini +config_switch=$1 +config_file=$2 +shift 2 +paster --plugin=ckan "$@" "$config_switch" "$config_file"