Browse Source

set up docker ldap for test (#27)

pull/2/merge
Cian Butler 4 years ago
committed by Tom Doyle
parent
commit
48f401883c
4 changed files with 37 additions and 6 deletions
  1. +10
    -6
      .circleci/config.yml
  2. +21
    -0
      docker-compose.yml
  3. +6
    -0
      useradm/Dockerfile
  4. +0
    -0
      useradm/requirements.txt

+ 10
- 6
.circleci/config.yml View File

@@ -1,15 +1,19 @@
---
version: 2
jobs:
build:
working_directory: ~/useradm
docker:
- image: python:3.5
working_directory: /home/ubuntu/useradm
- image: python:3-alpine
environment:
ENV: CI
- image: dinkel/openldap
environment:
SLAPD_PASSWORD: 'redbrick'
SLAPD_DOMAIN: 'ldap.internal'
steps:
- run: apk add --no-cache openldap-dev cyrus-sasl-dev git build-base
- checkout
- run: apt-get update && apt-get install libldap2-dev libsasl2-dev -y
- run: pip install -r requirements.txt
- store_artifacts:
path: test-reports/coverage
destination: reports
- store_test_results:
path: "test-reports/"

+ 21
- 0
docker-compose.yml View File

@@ -0,0 +1,21 @@
version: "3"
services:
useradm:
build: ./useradm
networks:
- internal
depends_on:
- ldap
ldap:
image: dinkel/openldap
container_name: ldap
networks:
- internal
environment:
SLAPD_PASSWORD: 'redbrick'
SLAPD_DOMAIN: 'ldap.redbrick'
volumes:
- ./ldif:/etc/ldap.dist/prepopulate

networks:
internal:

+ 6
- 0
useradm/Dockerfile View File

@@ -0,0 +1,6 @@
FROM python:3-alpine
WORKDIR /usr/src/app
ADD . /usr/src/app
RUN apk add --no-cache openldap-dev cyrus-sasl-dev build-base && \
pip install -r requirements.txt
CMD [ "python", "useradm.py" ]

requirements.txt → useradm/requirements.txt View File


Loading…
Cancel
Save