-
Notifications
You must be signed in to change notification settings - Fork 1
/
shippable.yml
52 lines (49 loc) · 2.43 KB
/
shippable.yml
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
42
43
44
45
46
47
48
49
50
51
52
build:
pre_ci:
- docker build -t test/ldap:latest .
- docker pull particlekit/ldap-client
- docker rm -f master || true
- docker rm -f master_data || true
- docker rm -f slave || true
- docker rm -f slave_data || true
- docker rm -f client || true
ci:
- mkdir -p "$SHIPPABLE_BUILD_DIR"/tests/slapd.d
- chmod 'og=-rwx' "$SHIPPABLE_BUILD_DIR"/tests/ssl/*private*
- docker run -i --name=master_data -d test/ldap:latest bash
- docker cp "$SHIPPABLE_BUILD_DIR"/tests/master/slapd.conf master_data:/config/slapd.conf
- docker cp "$SHIPPABLE_BUILD_DIR"/tests/ldap.conf master_data:/config/ldap.conf
- docker cp "$SHIPPABLE_BUILD_DIR"/tests/backup.ldif master_data:/backup/backup.ldif
- docker cp "$SHIPPABLE_BUILD_DIR"/tests/ssl master_data:/config/
- docker exec master_data chown 76:70 /config/ssl/master-private.pem
- docker exec master_data chown 76:70 /config/ssl/slave-private.pem
- docker cp "$SHIPPABLE_BUILD_DIR"/tests/slapd.d master_data:/etc/openldap/
- >
docker run -d --hostname master -e ROLE=master
--volumes-from master_data --name=master test/ldap:latest;
- docker run -i --name=slave_data -d test/ldap:latest bash
- docker cp "$SHIPPABLE_BUILD_DIR"/tests/slave/slapd.conf slave_data:/config/slapd.conf
- docker cp "$SHIPPABLE_BUILD_DIR"/tests/ldap.conf slave_data:/config/ldap.conf
- docker cp "$SHIPPABLE_BUILD_DIR"/tests/ssl slave_data:/config/
- docker exec slave_data chown 76:70 /config/ssl/master-private.pem
- docker exec slave_data chown 76:70 /config/ssl/slave-private.pem
- docker cp "$SHIPPABLE_BUILD_DIR"/tests/slapd.d slave_data:/etc/openldap/
- sleep 3
- docker logs master
- >
docker run -d --hostname slave -e ROLE=slave
--volumes-from slave_data --name=slave --link master test/ldap:latest;
- sleep 3
- docker logs slave
- >
docker run -d --name client
-e LDAP_HOST="master slave" -e LDAP_BASE="dc=ldaptest"
--link master --link slave particlekit/ldap-client sleep infinity;
- docker cp "$SHIPPABLE_BUILD_DIR"/tests/ldap.conf client:/etc/openldap/ldap.conf
- docker cp "$SHIPPABLE_BUILD_DIR"/tests/ssl client:/
- docker exec client ./init-ldap.sh
- docker exec client ldapsearch -H ldaps://master -x -b "dc=ldaptest"
- docker exec client ldapsearch -H ldaps://slave -x -b "dc=ldaptest"
- docker logs master
- docker logs slave
- docker logs client