From 1b6dab9852ad37c9bd9efff19b7d2e4bca947e70 Mon Sep 17 00:00:00 2001 From: Bertrand Gouny Date: Sun, 22 Jun 2014 17:48:54 +0200 Subject: [PATCH] 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