Browse Source

Merge branch 'release-0.8.0' into stable

Bertrand Gouny 11 years ago
parent
commit
a75d5c401e

+ 1 - 1
Dockerfile

@@ -1,4 +1,4 @@
-FROM osixia/baseimage:0.4.0
+FROM osixia/baseimage:0.5.0
 MAINTAINER Bertrand Gouny <[email protected]>
 
 # From Nick Stenning's work

+ 21 - 0
Makefile

@@ -0,0 +1,21 @@
+NAME = osixia/openldap
+VERSION = 0.8.0
+
+.PHONY: all build test tag_latest release
+
+all: build
+
+build:
+	docker.io build -t $(NAME):$(VERSION) --rm .
+
+test:
+	env NAME=$(NAME) VERSION=$(VERSION) ./test.sh
+
+tag_latest:
+	docker.io tag $(NAME):$(VERSION) $(NAME):latest
+
+release: build test tag_latest
+	@if ! docker.io images $(NAME) | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME) version $(VERSION) is not yet built. Please run 'make build'"; false; fi
+	docker.io push $(NAME)
+	@echo "*** Don't forget to run 'twgit release finish' :)"
+

+ 15 - 0
test-repository.sh

@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Usage
+# sudo ./test.sh 
+# add -v for verbose mode (or type whatever you like !) :p
+
+. test/config-repository
+. test/tools/run.sh
+
+run_test simple.sh "dn: dc=example,dc=com"
+run_test tls.sh "dn: dc=example,dc=com"
+run_test db.sh "dn: dc=otherdomain,dc=com"
+
+. test/tools/end.sh
+

+ 1 - 0
test.sh

@@ -4,6 +4,7 @@
 # sudo ./test.sh 
 # add -v for verbose mode (or type whatever you like !) :p
 
+. test/config
 . test/tools/run.sh
 
 run_test tools/build-container.sh "Successfully built"

+ 5 - 0
test/tools/config.prop → test/config

@@ -1,3 +1,8 @@
 testImage=openldap-test
 testContainer=openldap-test-container
 testDir=/osixia-test-docker-openldap
+
+export testImage
+export testContainer
+export testDir
+

+ 7 - 0
test/config-repository

@@ -0,0 +1,7 @@
+testImage=osixia/openldap:latest
+testContainer=openldap-repository-test-container
+testDir=/osixia-repository-test-docker-openldap
+
+export testImage
+export testContainer
+export testDir

+ 0 - 1
test/db.sh

@@ -1,7 +1,6 @@
 #!/bin/sh
 
 dir=$(dirname $0)
-. $dir/tools/config.prop
 
 if [ -d "$testDir" ]; then
   rm -r $testDir

+ 1 - 2
test/simple.sh

@@ -1,9 +1,8 @@
 #!/bin/sh
 
 dir=$(dirname $0)
-. $dir/tools/config.prop
-
 . $dir/tools/run-container.sh
+
 echo "ldapsearch -x -h $IP -b dc=example,dc=com"
 ldapsearch -x -h $IP -b dc=example,dc=com
 

+ 1 - 2
test/tls.sh

@@ -1,9 +1,8 @@
 #!/bin/sh
 
 dir=$(dirname $0)
-. $dir/tools/config.prop
-
 . $dir/tls/run.sh
+
 echo "ldapsearch -x -h $certCN -b dc=example,dc=com -ZZ"
 ldapsearch -x -h $certCN -b dc=example,dc=com -ZZ
 

+ 0 - 2
test/tools/build-container.sh

@@ -1,7 +1,5 @@
 #!/bin/sh
 
-. $(dirname $0)/config.prop
-
 docker.io build -t $testImage .
 #docker.io build --no-cache=true -t $testImage .
 

+ 0 - 2
test/tools/delete-container.sh

@@ -1,7 +1,5 @@
 #!/bin/sh
 
-. $(dirname $0)/config.prop
-
 # remove test container
 res=$(docker.io ps -a | grep -c "$testContainer")
 

+ 0 - 2
test/tools/delete-image.sh

@@ -1,7 +1,5 @@
 #!/bin/sh
 
-. $(dirname $0)/config.prop
-
 # remove test image
 res=$(docker.io images | grep -c "$testImage")
 

+ 8 - 3
test/tools/end.sh

@@ -1,8 +1,13 @@
 #!/bin/sh
 
-dir=$(dirname $0)
-$dir/delete-container.sh > /dev/null 2>&1
-$dir/delete-image.sh > /dev/null 2>&1
+./test/tools/delete-container.sh 
+./test/tools/delete-image.sh > /dev/null 2>&1
 
 echo "------- End -------"
 echo $error " failed " $ok " succeeded"
+
+if [ "$error" -eq 0 ]; then
+  exit 0
+else
+  exit 1
+fi

+ 2 - 2
test/tools/run-container.sh

@@ -2,10 +2,10 @@
 
 echo "docker.io run --name $testContainer $runOptions -d $testImage"
 ID=`docker.io run --name $testContainer $runOptions -d $testImage`
-sleep 7
+sleep 10
 
 echo " --> Obtaining IP"
-IP=`docker inspect -f "{{ .NetworkSettings.IPAddress }}" $ID`
+IP=`docker.io inspect -f "{{ .NetworkSettings.IPAddress }}" $ID`
 if [ "$IP" = "" ]; then
 	abort "Unable to obtain container IP"
 	exit 1