-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from CodeForAfrica/chore-upgrade-to-ckan-2.9
Chore upgrade to ckan 2.9
- Loading branch information
Showing
10 changed files
with
193 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,53 @@ | ||
FROM codeforafrica/ckan:2.8.3 | ||
FROM ckan/ckan-dev:2.9 | ||
|
||
EXPOSE 5000/tcp | ||
# Install any extensions needed by your CKAN instance | ||
# - Make sure to add the plugins to CKAN__PLUGINS in the .env file | ||
# - Also make sure all provide all extra configuration options, either by: | ||
# * Adding them to the .env file (check the ckanext-envvars syntax for env vars), or | ||
# * Adding extra configuration scripts to /docker-entrypoint.d folder) to update | ||
# the CKAN config file (ckan.ini) with the `ckan config-tool` command | ||
# | ||
# See README > Extending the base images for more details | ||
# | ||
# For instance: | ||
### OpenAfrica ### | ||
RUN pip3 install -e git+https://github.com/CodeForAfrica/ckanext-openafrica.git@ft/ui-changes#egg=ckanext-openafrica | ||
|
||
WORKDIR / | ||
### Datarequests | ||
RUN pip3 install -e git+https://github.com/qld-gov-au/ckanext-datarequests.git#egg=ckanext-datarequests | ||
|
||
ADD requirements.txt /requirements.txt | ||
RUN pip install -q -r /requirements.txt && \ | ||
pip install -q -r /src/ckanext-s3filestore/requirements.txt && \ | ||
pip install -q -r /src/ckanext-harvest/pip-requirements.txt && \ | ||
pip install -q -r /src/ckanext-dcat/requirements.txt | ||
### Harvester ### | ||
RUN pip3 install -e git+https://github.com/ckan/ckanext-harvest.git@master#egg=ckanext-harvest && \ | ||
pip3 install -r ${APP_DIR}/src/ckanext-harvest/pip-requirements.txt | ||
|
||
# RUN ln -s ./src/ckan/ckan/config/who.ini /who.ini | ||
ADD ckan.ini /ckan.ini | ||
## s3filestore | ||
RUN pip3 install -e git+https://github.com/qld-gov-au/ckanext-s3filestore.git#egg=ckanext-s3filestore && \ | ||
pip3 install -r ${APP_DIR}/src/ckanext-s3filestore/requirements.txt | ||
|
||
ADD Procfile /Procfile | ||
## ckan GoogleAnalytics | ||
RUN pip3 install -e git+https://github.com/ckan/ckanext-googleanalytics.git#egg=ckanext-googleanalytics && \ | ||
pip3 install -r ${APP_DIR}/src/ckanext-googleanalytics/requirements.txt | ||
|
||
CMD ["gunicorn", "--workers", "3", "--worker-class", "gevent", "--paste", "ckan.ini", "-t", "600"] | ||
## ckanext-showcase | ||
RUN pip3 install -e git+https://github.com/ckan/ckanext-showcase.git#egg=ckanext-showcase && \ | ||
pip3 install -r ${APP_DIR}/src/ckanext-showcase/requirements.txt | ||
|
||
# Clone the extension(s) your are writing for your own project in the `src` folder | ||
# to get them mounted in this image at runtime | ||
# COPY ckanext-openafrica/* {APP_DIR}/src/ckanext-openafrica/ | ||
# RUN cd {APP_DIR}/src/ckanext-openafrica && python3 setup.py develop | ||
|
||
# Copy custom initialization scripts | ||
COPY contrib/ckan/docker-entrypoint.d/* /docker-entrypoint.d/ | ||
|
||
# Apply any patches needed to CKAN core or any of the built extensions (not the | ||
# runtime mounted ones) | ||
# COPY patches ${APP_DIR}/patches | ||
|
||
# RUN for d in $APP_DIR/patches/*; do \ | ||
# if [ -d $d ]; then \ | ||
# for f in `ls $d/*.patch | sort -g`; do \ | ||
# cd $SRC_DIR/`basename "$d"` && echo "$0: Applying patch $f to $SRC_DIR/`basename $d`"; patch -p1 < "$f" ; \ | ||
# done ; \ | ||
# fi ; \ | ||
# done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
web: gunicorn --workers 5 --worker-class gevent --paste ckan.ini -t 10800 | ||
ckan_gather_consumer: paster --plugin=ckanext-harvest harvester gather_consumer --config=ckan.ini | ||
ckan_fetch_consumer: paster --plugin=ckanext-harvest harvester fetch_consumer --config=ckan.ini | ||
web: gunicorn --workers 5 --worker-class gevent --ckan ckan.ini -t 10800 | ||
|
||
ckan_gather_consumer: ckan --config=ckan.ini --plugin=ckanext-harvest harvester gather_consumer | ||
|
||
ckan_fetch_consumer: ckan --config=ckan.ini --plugin=ckanext-harvest harvester fetch_consumer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,53 @@ | ||
FROM python:2.7 | ||
FROM ckan/ckan-dev:2.9 | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
# Install any extensions needed by your CKAN instance | ||
# - Make sure to add the plugins to CKAN__PLUGINS in the .env file | ||
# - Also make sure all provide all extra configuration options, either by: | ||
# * Adding them to the .env file (check the ckanext-envvars syntax for env vars), or | ||
# * Adding extra configuration scripts to /docker-entrypoint.d folder) to update | ||
# the CKAN config file (ckan.ini) with the `ckan config-tool` command | ||
# | ||
# See README > Extending the base images for more details | ||
# | ||
# For instance: | ||
# | ||
### OpenAfrica ### | ||
RUN pip3 install -e git+https://github.com/CodeForAfrica/ckanext-openafrica.git@ft/upgrade-ckan-2.9#egg=ckanext-openafrica | ||
|
||
ARG CKAN_VERSION=2.8.11 | ||
### XLoader ### | ||
#RUN pip3 install -e 'git+https://github.com/ckan/ckanext-xloader.git@master#egg=ckanext-xloader' && \ | ||
# pip3 install -r ${APP_DIR}/src/ckanext-xloader/requirements.txt && \ | ||
# pip3 install -U requests[security] | ||
|
||
RUN pip install -U -q pip setuptools | ||
### Harvester ### | ||
#RUN pip3 install -e 'git+https://github.com/ckan/ckanext-harvest.git@master#egg=ckanext-harvest' && \ | ||
# pip3 install -r ${APP_DIR}/src/ckanext-harvest/pip-requirements.txt | ||
# will also require gather_consumer and fetch_consumer processes running (please see https://github.com/ckan/ckanext-harvest) | ||
|
||
RUN pip install -q -e "git+https://github.com/ckan/ckan.git@ckan-${CKAN_VERSION}#egg=ckan" | ||
### Scheming ### | ||
#RUN pip3 install -e 'git+https://github.com/ckan/ckanext-scheming.git@master#egg=ckanext-scheming' | ||
|
||
ADD meta.py /src/ckan/ckan/model/meta.py | ||
### Pages ### | ||
#RUN pip3 install -e git+https://github.com/ckan/ckanext-pages.git#egg=ckanext-pages | ||
|
||
RUN pip install -q -r /src/ckan/requirements.txt | ||
RUN pip install -q vdm==0.15 sqlalchemy==1.2.19 | ||
### DCAT ### | ||
#RUN pip3 install -e git+https://github.com/ckan/ckanext-dcat.git@v0.0.6#egg=ckanext-dcat && \ | ||
# pip3 install -r https://raw.githubusercontent.com/ckan/ckanext-dcat/v0.0.6/requirements.txt | ||
|
||
# Clone the extension(s) your are writing for your own project in the `src` folder | ||
# to get them mounted in this image at runtime | ||
|
||
# Copy custom initialization scripts | ||
COPY docker-entrypoint.d/* /docker-entrypoint.d/ | ||
|
||
# Apply any patches needed to CKAN core or any of the built extensions (not the | ||
# runtime mounted ones) | ||
# COPY patches ${APP_DIR}/patches | ||
|
||
# RUN for d in $APP_DIR/patches/*; do \ | ||
# if [ -d $d ]; then \ | ||
# for f in `ls $d/*.patch | sort -g`; do \ | ||
# cd $SRC_DIR/`basename "$d"` && echo "$0: Applying patch $f to $SRC_DIR/`basename $d`"; patch -p1 < "$f" ; \ | ||
# done ; \ | ||
# fi ; \ | ||
# done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
#Setup CKAN Datarequests (Init DB) | ||
if [[ $CKAN__PLUGINS == *"datarequests"* ]]; then | ||
ckan -c /srv/app/ckan.ini datarequests init-db | ||
else | ||
echo "Datarequests extension not available" | ||
fi | ||
|
||
if [[ $CKAN__PLUGINS == *"openafrica"* ]]; then | ||
ckan config-tool ${CKAN_INI} -s app:main -e ckan.site_title="openAFRICA" | ||
ckan config-tool ${CKAN_INI} -s app:main -e ckan.site_description=""Africa's largest independent source for open data" | ||
else | ||
echo "Not appliyng OpenAfrica customizations" | ||
fi |
Oops, something went wrong.