aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorStephane Desneux <stephane.desneux@iot.bzh>2017-03-27 14:32:48 +0200
committerStephane Desneux <stephane.desneux@iot.bzh>2017-03-27 14:49:04 +0200
commit7a305b6779b7cbf7ddf22dbaaf2c168b4c4697aa (patch)
tree3faa8ac6c8c863a872c8ad55c7de9b7c6a396478 /Makefile
parent00bd644c0fbaf489fe32863d9fea3f3977975624 (diff)
disable interactive mode in usual target 'build'
In Jenkins, the build job will now fail without breaking and waiting for user interaction. This patch also adds a new target 'build-debug' where debug is active. So to summarize: * 'make build-debug' does as before (interactive mode on error) * 'make build' won't go interactive anymore and will simply fail (used by jenkins) Change-Id: I951cecb58d03b48e4779086a9fba9b5a88889fca Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 17 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index f08ca2d..9f19a55 100644
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,7 @@ help:
@echo "- clean: drop existing container and image"
@echo "- distclean: drop temp images (the one produced by a bad Dockerfile...)"
@echo "- build: create new image"
+ @echo "- build-debug: create new image (debug mode = break and wait at first error)"
@echo "- test: start a new test container and enter in it. After exit, the container is destoyed"
@echo "- push: push the image to registry $(REGISTRY)"
@echo "- push-latest: push the image to registry $(REGISTRY) and also tag as 'latest'"
@@ -55,6 +56,7 @@ clean:
echo "Removing image $(IMAGE_LATEST)"; \
docker rmi $(IMAGE_LATEST) ; \
} || true
+ @rm -f INSTALL/DEBUG
# remove spurious containers and images left by broken builds
.PHONY:distclean
@@ -64,11 +66,23 @@ distclean: clean
docker rmi $$imgid; \
done
+.PHONY:build-debug
+build-debug:
+ @echo "------------------- Building image $(NAME) (debug mode) -------------------"
+ @touch INSTALL/DEBUG
+ @docker build --no-cache=true --rm --pull -t $(IMAGE_NAME) .
+ @rm -f INSTALL/DEBUG
+ @docker images
+
+# inside jenkins, we don't want the build script to break and wait for interaction
+# after first error. So we remove the file inside INSTALL dir which indicates to the
+# setup script to enable DEBUG.
.PHONY:build
build:
- @echo "------------------- Building image $(NAME) -------------------"; \
- docker build --no-cache=true --rm --pull -t $(IMAGE_NAME) .
- docker images
+ @echo "------------------- Building image $(NAME) -------------------"
+ @rm -f INSTALL/DEBUG
+ @docker build --no-cache=true --rm --pull -t $(IMAGE_NAME) .
+ @docker images
.PHONY:test
test: