From 6fcc54f372901290387ed4cb796e850a1806d1a1 Mon Sep 17 00:00:00 2001 From: Martin van Es Date: Tue, 24 Sep 2024 10:42:35 +0200 Subject: [PATCH] WIP --- .github/workflows/ci.yml | 18 ++++++++++++++++-- run-ldapci.sh | 4 ++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76ef8c7..05464b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,8 @@ jobs: ports: - 389:389 volumes: - - ./misc/schema:/opt/misc/schema + - ${{ github.workspace }}/misc/schema:/opt/misc/schema + options: --name ldap env: LDAP_SEED_INTERNAL_SCHEMA_PATH: /opt/misc/schema LDAP_DOMAIN: services.sram.tld @@ -38,7 +39,15 @@ jobs: LDAP_TLS: true steps: - # - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + - name: Checkout + uses: actions/checkout@master + with: + path: plsc + + - name: Restart LDAP container + uses: docker://docker + with: + args: docker restart ldap - name: Install dependencies run: sudo apt-get update && sudo apt-get install -y libsasl2-dev libldap2-dev ldap-utils @@ -49,16 +58,19 @@ jobs: python-version: ${{ matrix.python }} - name: Install dependencies + working-directory: ./plsc run: | python3 -m pip install --upgrade pip flake8 gera2ld-pyserve pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Check syntax + working-directory: ./plsc run: | flake8 . - name: ldap - Initialization... + working-directory: ./plsc run: > sleep 5; ldapwhoami -H ${LDAP_URL} -D ${LDAP_BIND_DN} -w ${LDAP_ADMIN_PASSWORD}; @@ -81,6 +93,7 @@ jobs: # uses: mxschmitt/action-tmate@v3 - name: Run pytest... + working-directory: ./plsc run: | export PYTHONPATH="." pytest @@ -91,6 +104,7 @@ jobs: LDAP_BIND_DN: cn=admin,dc=services,dc=sram,dc=tld - name: Dump ldap... + working-directory: ./plsc run: ldapsearch -x -H ${LDAP_URL} -b ${LDAP_BASE_DN} -s sub objectclass=organizationalUnit env: diff --git a/run-ldapci.sh b/run-ldapci.sh index 68572e1..e3ae811 100755 --- a/run-ldapci.sh +++ b/run-ldapci.sh @@ -1,5 +1,5 @@ #!/bin/sh -docker rm ldap-ci || true +docker rm ldap || true docker run -ti \ -e "LDAP_SEED_INTERNAL_SCHEMA_PATH=/opt/misc/schema" \ -e "LDAP_DOMAIN=services.sram.tld" \ @@ -10,5 +10,5 @@ docker run -ti \ -e "LDAP_TLS=true" \ -v "./misc/schema:/opt/misc/schema" \ -p 389:389 \ - --name ldap-ci \ + --name ldap \ osixia/openldap:latest