Skip to content

Commit

Permalink
ci: Update the Dockerfile to be useful for testing slapd-regtest.
Browse files Browse the repository at this point in the history
Tested with `podman build .`

Issue: #98
  • Loading branch information
jaqx0r committed Dec 22, 2022
1 parent dbb9115 commit 30a785a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
20 changes: 14 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
FROM python:3
FROM python:3.10
RUN apt-get update
RUN apt-get install -y libsasl2-dev libldap2-dev libssl-dev
RUN mkdir /code
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get install -y libsasl2-dev libldap2-dev libssl-dev slapd ldap-utils

ENV VIRTUAL_ENV=/opt/venv
RUN python -m venv $VIRTUAL_ENV
ENV PATH=$VIRTUAL_ENV/bin:$PATH

WORKDIR /code
ADD requirements.txt /code/

ADD ./requirements.txt /code/requirements.txt
RUN pip install -r requirements.txt
ADD . /code/

CMD [ "python", "./runtests.py" ]
ADD . /code
RUN python setup.py test
RUN python setup.py install
RUN tests/slapd-regtest
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ Issue history is at https://code.google.com/p/nsscache/issues/list
# Contributions

Please format your code with https://github.com/google/yapf (installable as `pip install yapf` or the `yapf3` package on Debian systems) before sending pull requests.

# Testing

The [`Dockerfile`](Dockerfile) sets up a container that then executes the python unit tests and [`tests/slapd-regtest`](tests/slapd-regtest) integration test. Execute that with `podman build .` to get a reproducible test environment.

The `Dockerfile` mimics the test environment used by the Github Actions workflow [`.github/workflows/ci.yml`](.github/workflows/ci.yml)

0 comments on commit 30a785a

Please sign in to comment.