From ea563acee97a180a64b59dea5e17ae32d2b19121 Mon Sep 17 00:00:00 2001 From: Bertrand Gouny Date: Sun, 22 Jun 2014 17:03:25 +0200 Subject: [PATCH 1/8] [twgit] Init feature 'feature-makefile'. From 1b6dab9852ad37c9bd9efff19b7d2e4bca947e70 Mon Sep 17 00:00:00 2001 From: Bertrand Gouny Date: Sun, 22 Jun 2014 17:48:54 +0200 Subject: [PATCH 2/8] makefile --- Makefile | 21 +++++++++++++++++++++ test/tools/end.sh | 6 ++++++ test/tools/run-container.sh | 4 ++-- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..49daa92 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +NAME = osixia/openldap +VERSION = 0.7.4 + +.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' :)" + diff --git a/test/tools/end.sh b/test/tools/end.sh index af388d5..93a8fc6 100755 --- a/test/tools/end.sh +++ b/test/tools/end.sh @@ -6,3 +6,9 @@ $dir/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 diff --git a/test/tools/run-container.sh b/test/tools/run-container.sh index 7640257..3319e09 100755 --- a/test/tools/run-container.sh +++ b/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 From e553d3749d7a204be100b8c0ee2a6b90a13320fb Mon Sep 17 00:00:00 2001 From: Bertrand Gouny Date: Mon, 23 Jun 2014 19:20:51 +0200 Subject: [PATCH 3/8] [twgit] Init feature 'feature-new-tests'. From 6cfd595bd590baacee84d9c1c55f0ebe98b3ece6 Mon Sep 17 00:00:00 2001 From: Bertrand Gouny Date: Mon, 23 Jun 2014 21:30:04 +0200 Subject: [PATCH 4/8] nouveaux tests --- test-repository.sh | 15 +++++++++++++++ test.sh | 1 + test/{tools/config.prop => config} | 5 +++++ test/config-repository | 7 +++++++ test/db.sh | 1 - test/simple.sh | 3 +-- test/tls.sh | 3 +-- test/tools/build-container.sh | 2 -- test/tools/delete-container.sh | 2 -- test/tools/delete-image.sh | 2 -- test/tools/end.sh | 5 ++--- 11 files changed, 32 insertions(+), 14 deletions(-) create mode 100755 test-repository.sh rename test/{tools/config.prop => config} (64%) mode change 100644 => 100755 create mode 100755 test/config-repository diff --git a/test-repository.sh b/test-repository.sh new file mode 100755 index 0000000..5d31116 --- /dev/null +++ b/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 + diff --git a/test.sh b/test.sh index bff84aa..4daa2d3 100755 --- a/test.sh +++ b/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" diff --git a/test/tools/config.prop b/test/config old mode 100644 new mode 100755 similarity index 64% rename from test/tools/config.prop rename to test/config index fd412f9..9199745 --- a/test/tools/config.prop +++ b/test/config @@ -1,3 +1,8 @@ testImage=openldap-test testContainer=openldap-test-container testDir=/osixia-test-docker-openldap + +export testImage +export testContainer +export testDir + diff --git a/test/config-repository b/test/config-repository new file mode 100755 index 0000000..c54c31a --- /dev/null +++ b/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 diff --git a/test/db.sh b/test/db.sh index 8411776..79b1f59 100755 --- a/test/db.sh +++ b/test/db.sh @@ -1,7 +1,6 @@ #!/bin/sh dir=$(dirname $0) -. $dir/tools/config.prop if [ -d "$testDir" ]; then rm -r $testDir diff --git a/test/simple.sh b/test/simple.sh index bae1ce2..4186276 100755 --- a/test/simple.sh +++ b/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 diff --git a/test/tls.sh b/test/tls.sh index eaa5dab..0ee296d 100755 --- a/test/tls.sh +++ b/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 diff --git a/test/tools/build-container.sh b/test/tools/build-container.sh index 1128c7c..7103b87 100755 --- a/test/tools/build-container.sh +++ b/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 . diff --git a/test/tools/delete-container.sh b/test/tools/delete-container.sh index 505a00f..dc33aae 100755 --- a/test/tools/delete-container.sh +++ b/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") diff --git a/test/tools/delete-image.sh b/test/tools/delete-image.sh index 6931c9e..9704547 100755 --- a/test/tools/delete-image.sh +++ b/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") diff --git a/test/tools/end.sh b/test/tools/end.sh index af388d5..c136f78 100755 --- a/test/tools/end.sh +++ b/test/tools/end.sh @@ -1,8 +1,7 @@ #!/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" From d4e039a2bf2883b9c0f555093b9b749afd9d1361 Mon Sep 17 00:00:00 2001 From: Bertrand Gouny Date: Tue, 24 Jun 2014 15:01:44 +0200 Subject: [PATCH 5/8] [twgit] Init feature 'feature-new-baseimage'. From b7a269154502fdec68627b2a885bd897ebfa454c Mon Sep 17 00:00:00 2001 From: Bertrand Gouny Date: Tue, 24 Jun 2014 15:04:49 +0200 Subject: [PATCH 6/8] base --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2322634..d78feb3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM osixia/baseimage:0.4.0 +FROM osixia/baseimage:0.5.0 MAINTAINER Bertrand Gouny # From Nick Stenning's work From d36e3dd10ec7ad74c30a8368b83e45a73c4bfe35 Mon Sep 17 00:00:00 2001 From: Bertrand Gouny Date: Tue, 24 Jun 2014 15:11:46 +0200 Subject: [PATCH 7/8] [twgit] Init release 'release-0.8.0'. From 8e81c4574debf33fdaa59eb16be0ff542683f582 Mon Sep 17 00:00:00 2001 From: Bertrand Gouny Date: Tue, 24 Jun 2014 15:33:22 +0200 Subject: [PATCH 8/8] version --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 49daa92..1db2a6c 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ NAME = osixia/openldap -VERSION = 0.7.4 +VERSION = 0.8.0 .PHONY: all build test tag_latest release