Change openldap/Makefile.
This commit is contained in:
parent
d274c1a2ac
commit
9413293578
|
@ -1,3 +1,5 @@
|
||||||
|
CONTAINER := phi_slapd
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: build run
|
all: build run
|
||||||
|
|
||||||
|
@ -17,22 +19,34 @@ clean:
|
||||||
rm -f key.pem cert.pem
|
rm -f key.pem cert.pem
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run:
|
run: prepare
|
||||||
docker run -p 389:389 --rm unit/slapd
|
docker attach phi_slapd
|
||||||
|
|
||||||
.PHONY: shell
|
.PHONY: prepare
|
||||||
shell:
|
prepare:
|
||||||
LDAPTLS_REQCERT=never sh
|
docker run -p 389:389 -d --name="$(CONTAINER)" --rm unit/slapd
|
||||||
|
sleep 2
|
||||||
.PHONY: populate
|
LDAPTLS_REQCERT=never \
|
||||||
populate:
|
ldapmodify -ZZ -H ldap://127.0.0.1:389 \
|
||||||
ldapmodify -ZZ -H ldap://127.0.0.1 \
|
|
||||||
-x -D "cn=root,dc=unit,dc=macaomilano,dc=org" -w root \
|
-x -D "cn=root,dc=unit,dc=macaomilano,dc=org" -w root \
|
||||||
-a -f init.ldif
|
-a -f init.ldif
|
||||||
|
|
||||||
|
.PHONY: run-bg
|
||||||
|
run-bg:
|
||||||
|
make prepare
|
||||||
|
|
||||||
|
.PHONY: stop
|
||||||
|
stop: is-running
|
||||||
|
docker stop $(CONTAINER)
|
||||||
|
|
||||||
|
.PHONY: is-running
|
||||||
|
is-running:
|
||||||
|
@[[ $$(docker ps -qf=name=$(CONTAINER)|wc -l) -eq 1 ]]
|
||||||
|
|
||||||
.PHONY: inspect
|
.PHONY: inspect
|
||||||
inspect:
|
inspect: is-running
|
||||||
ldapsearch -ZZ -H ldap://127.0.0.1 \
|
LDAPTLS_REQCERT=never \
|
||||||
|
ldapsearch -ZZ -H ldap://127.0.0.1 \
|
||||||
-x -D "cn=root,dc=unit,dc=macaomilano,dc=org" -w root \
|
-x -D "cn=root,dc=unit,dc=macaomilano,dc=org" -w root \
|
||||||
-b "dc=unit,dc=macaomilano,dc=org" \
|
-b "dc=unit,dc=macaomilano,dc=org" \
|
||||||
'(objectclass=*)'
|
'(objectclass=*)'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user