Skip to content

Commit 8d2742e

Browse files
Add optional openldap container
1 parent 35c27a7 commit 8d2742e

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ on:
1919
required: false
2020
type: string
2121
default: ""
22+
extra-services:
23+
description: "A list of coma separated services. Available services: openldap."
24+
required: false
25+
type: string
26+
default: ""
2227

2328
jobs:
2429
ci:
@@ -38,6 +43,15 @@ jobs:
3843
MYSQL_DATABASE: "glpi"
3944
options: >-
4045
--shm-size=1g
46+
openldap:
47+
# Workaround to only add the service if a given variable is set.
48+
# See: https://github.com/actions/runner/issues/822
49+
image: "${{ contains(inputs.extra-services, 'openldap') && 'osixia/openldap:latest' || '' }}"
50+
env:
51+
LDAP_ORGANISATION: "GLPI"
52+
LDAP_DOMAIN: "glpi.org"
53+
LDAP_ADMIN_USERNAME: "admin"
54+
LDAP_ADMIN_PASSWORD: "admin"
4155
defaults:
4256
run:
4357
# By default, execute commands using the `www-data` user to prevent rights issues on GLPI generated files.
@@ -95,6 +109,14 @@ jobs:
95109
if: ${{ !cancelled() && hashFiles(format('{0}/package.json', inputs.plugin-key)) != '' }}
96110
run: |
97111
npm install --no-save
112+
# We now need to load the ldif data in the openldap server.
113+
# TODO: bake the .ldif directly in a custom image so we don't need to do this.
114+
- name: "Import LDIF"
115+
if: ${{ contains(inputs.extra-services, 'openldap') }}
116+
run: |
117+
ldapadd -x -D "cn=admin,dc=glpi,dc=org" -w admin \
118+
-f ../../tests/LDAP/ldif/10-users.ldif \
119+
-H ldap://openldap:389
98120
- name: "PHP Parallel Lint"
99121
run: |
100122
echo -e "\033[0;33mExecuting PHP Parallel Lint...\033[0m"

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ jobs:
4646

4747
# Optional initialization script that can be used, for instance, to install additional system dependencies.
4848
init-script: "./.github/workflows/init-script.sh"
49+
50+
# Optional extra services (possible values: "openldap").
51+
extra-services: "openldap"
4952
```
5053
5154
The available `glpi-version`/`php-version` combinations corresponds to the `ghcr.io/glpi-project/githubactions-glpi-apache` images tags

0 commit comments

Comments
 (0)