diff --git a/docker-compose.yml b/docker-compose.yml index c83485e..0885664 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,25 @@ version: "3" services: - ckan: + latest: build: context: . - dockerfile: docker/Dockerfile + dockerfile: docker/Dockerfile_latest + environment: + PYTHONUNBUFFERED: 1 + PYTHONDONTWRITEBYTECODE: 1 + depends_on: + - db + - solr + - redis + volumes: + - ./ckanext:/base/src/ckanext-ldap/ckanext + - ./tests:/base/src/ckanext-ldap/tests + + next: + build: + context: . + dockerfile: docker/Dockerfile_next environment: PYTHONUNBUFFERED: 1 PYTHONDONTWRITEBYTECODE: 1 diff --git a/docker/Dockerfile b/docker/Dockerfile_latest similarity index 100% rename from docker/Dockerfile rename to docker/Dockerfile_latest diff --git a/docker/Dockerfile_next b/docker/Dockerfile_next new file mode 100644 index 0000000..4a4363e --- /dev/null +++ b/docker/Dockerfile_next @@ -0,0 +1,21 @@ +FROM naturalhistorymuseum/ckantest:next + +# required by python-ldap +RUN apt-get -q -y install libldap2-dev libsasl2-dev \ + && apt-get -q clean \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /base/src/ckanext-ldap + +# copy over the source +COPY . . + +# install the base + test dependencies +RUN pip install -e .[test] + +# this entrypoint ensures our service dependencies (postgresql, solr and redis) are running before +# running the cmd +ENTRYPOINT ["/bin/bash", "/opt/waits/basic.sh"] + +# run the tests with coverage output +CMD ["bash", "/opt/scripts/run-tests.sh", "ckanext.ldap"]