-
Notifications
You must be signed in to change notification settings - Fork 0
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 #1 from NaturalHistoryMuseum/josh/ckan-upgrade-2.9
CKAN 2.9.x upgrade
- Loading branch information
Showing
19 changed files
with
371 additions
and
103 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[run] | ||
relative_files = True |
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 |
---|---|---|
|
@@ -40,3 +40,5 @@ coverage.xml | |
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
.idea |
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,16 @@ | ||
sudo: required | ||
|
||
language: python | ||
|
||
services: | ||
- docker | ||
|
||
# we need coveralls and this also prevents travis from running pip install -r requirements.txt | ||
install: pip install coveralls | ||
|
||
script: | ||
- docker-compose build | ||
- docker-compose run ckan | ||
|
||
after_success: coveralls | ||
|
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
# encoding: utf-8 | ||
|
||
# this is a namespace package | ||
try: | ||
import pkg_resources | ||
pkg_resources.declare_namespace(__name__) | ||
except ImportError: | ||
import pkgutil | ||
__path__ = pkgutil.extend_path(__path__, __name__) |
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
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,19 +1,18 @@ | ||
from collections import OrderedDict | ||
|
||
from ckan.plugins import toolkit | ||
from collections import OrderedDict | ||
from flask import Blueprint, jsonify | ||
|
||
blueprint = Blueprint(name=u'iiif', import_name=__name__, url_prefix=u'/iiif') | ||
blueprint = Blueprint(name='iiif', import_name=__name__, url_prefix='/iiif') | ||
|
||
builders = OrderedDict() | ||
|
||
|
||
@blueprint.route(u'/<path:identifier>') | ||
@blueprint.route('/<path:identifier>') | ||
def resource(identifier): | ||
for regex, get_builder_function in builders.items(): | ||
match = regex.match(identifier) | ||
if match: | ||
builder = get_builder_function(**match.groupdict()) | ||
return jsonify(builder.build()) | ||
|
||
return toolkit.abort(status_code=404, detail=u'Unknown IIIF identifier') | ||
return toolkit.abort(status_code=404, detail='Unknown IIIF identifier') |
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,2 @@ | ||
pytest>=4.6.5 | ||
pytest-cov>=2.7.1 |
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,39 @@ | ||
version: "3" | ||
|
||
services: | ||
ckan: | ||
build: | ||
context: . | ||
dockerfile: docker/Dockerfile | ||
environment: | ||
PYTHONUNBUFFERED: 1 | ||
PYTHONDONTWRITEBYTECODE: 1 | ||
depends_on: | ||
- db | ||
- solr | ||
- redis | ||
volumes: | ||
- .:/srv/app/src/ckanext-iiif | ||
|
||
solr: | ||
build: | ||
context: https://github.com/okfn/docker-ckan.git#:solr | ||
logging: | ||
driver: none | ||
|
||
db: | ||
build: | ||
context: https://github.com/okfn/docker-ckan.git#:postgresql | ||
args: | ||
- DATASTORE_READONLY_PASSWORD=password | ||
- POSTGRES_PASSWORD=password | ||
environment: | ||
- DATASTORE_READONLY_PASSWORD=password | ||
- POSTGRES_PASSWORD=password | ||
logging: | ||
driver: none | ||
|
||
redis: | ||
image: redis:latest | ||
logging: | ||
driver: none |
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,25 @@ | ||
FROM openknowledge/ckan-dev:2.9 | ||
|
||
# ckan is installed in /srv/app/src/ckan in the ckan-dev image we're basing this image on | ||
WORKDIR /srv/app/src/ckanext-iiif | ||
|
||
# copy over the ckanext-iiif source | ||
COPY . . | ||
|
||
# might as well update pip while we're here! | ||
RUN pip3 install --upgrade pip | ||
|
||
# fixes this https://github.com/ckan/ckan/issues/5570 | ||
RUN pip3 install pytest-ckan | ||
|
||
# install the dependencies | ||
RUN python3 setup.py develop && \ | ||
pip3 install -r requirements.txt && \ | ||
pip3 install -r dev_requirements.txt | ||
|
||
# this entrypoint ensures our service dependencies (postgresql, solr and redis) are running before | ||
# running the cmd | ||
ENTRYPOINT ["/bin/bash", "docker/entrypoint.sh"] | ||
|
||
# run the tests with coverage output | ||
CMD ["pytest", "--cov=ckanext.iiif", "--ckan-ini=test.ini", "tests"] |
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,24 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
echo "Wait for PostgreSQL to start..." | ||
while ! pg_isready -h db -U ckan; do | ||
sleep 1; | ||
done | ||
echo "PostgreSQL started" | ||
|
||
echo "Wait for Solr to start..." | ||
while ! curl -s "http://solr:8983/solr/ckan/admin/ping" | grep -q OK; do | ||
sleep 1; | ||
done | ||
echo "Solr started" | ||
|
||
echo "Wait for Redis to start..." | ||
while ! echo -e "PING" | nc -w 1 redis 6379 | grep -q "+PONG"; do | ||
sleep 1; | ||
done | ||
echo "Redis started" | ||
|
||
echo "All services up, running command" | ||
|
||
exec "$@" |
Oops, something went wrong.