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 c136f78..b6af5d5 100755 --- a/test/tools/end.sh +++ b/test/tools/end.sh @@ -5,3 +5,9 @@ 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