File: mock-auth-backend-ldap

package info (click to toggle)
rabbitmq-server 4.0.5-6
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 37,948 kB
  • sloc: erlang: 257,835; javascript: 22,466; sh: 2,796; makefile: 2,517; python: 1,966; xml: 646; cs: 335; java: 244; ruby: 212; php: 100; perl: 63; awk: 13
file content (41 lines) | stat: -rw-r--r-- 1,132 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash

ensure_mock-auth-backend-ldap() {
  if docker ps | grep mock-auth-backend-ldap &> /dev/null; then
     print "mock-auth-backend-ldap already running ..."
 else
   start_mock-auth-backend-ldap
 fi
}
init_mock-auth-backend-ldap() {
  AUTH_BACKEND_LDAP_DIR=${TEST_CONFIG_DIR}/mock-auth-backend-ldap

  print "> AUTH_BACKEND_LDAP_DIR: ${AUTH_BACKEND_LDAP_DIR}"
}
start_mock-auth-backend-ldap() {
  begin "Starting mock-auth-backend-ldap ..."

  init_mock-auth-backend-ldap
  kill_container_if_exist mock-auth-backend-ldap

  docker run \
    --detach \
    --name mock-auth-backend-ldap \
    --net ${DOCKER_NETWORK} \
    --env LDAP_ORGANISATION="Authentication and Tags" \
    --env LDAP_DOMAIN="example.com" \
    --env LDAP_ADMIN_PASSWORD="admin" \
    --publish 389:389 \
    --publish 636:636 \
    -v ${AUTH_BACKEND_LDAP_DIR}:/config \
    osixia/openldap:1.2.1

  wait_for_message mock-auth-backend-ldap "starting"
  docker exec mock-auth-backend-ldap ldapadd \
    -x -w "admin" \
    -H ldap:// \
    -D "cn=admin,dc=example,dc=com" \
    -f /config/import.ldif

  end "mock-auth-backend-ldap is ready"
}