Browse Source

Merge branch 'feature-makefile' into release-0.8.0

Bertrand Gouny 11 years ago
parent
commit
e4a4f6a667
3 changed files with 29 additions and 2 deletions
  1. 21 0
      Makefile
  2. 6 0
      test/tools/end.sh
  3. 2 2
      test/tools/run-container.sh

+ 21 - 0
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' :)"
+

+ 6 - 0
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

+ 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