aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rwxr-xr-xINSTALL/setup_image.sh8
-rw-r--r--Makefile20
3 files changed, 24 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index 726c3ca..701b867 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
.*.sw*
+INSTALL/DEBUG
diff --git a/INSTALL/setup_image.sh b/INSTALL/setup_image.sh
index 00a0a50..b7df59d 100755
--- a/INSTALL/setup_image.sh
+++ b/INSTALL/setup_image.sh
@@ -18,12 +18,16 @@ function debug() {
set -x
return 0 # continue
}
-trap debug ERR # on error, run a sleep tp debug container
-
# get the INSTALL dir (the one where we were launched)
INSTDIR=$(cd $(dirname $0) && pwd -P)
echo "Detected container install dir = $INSTDIR"
+if [[ -f $INSTDIR/DEBUG ]]; then
+ echo "#### DEBUG MODE IS ACTIVE ####"
+ trap debug ERR # on error, run a sleep tp debug container
+fi
+
+
################################## variables #################################
# source variables in conf file
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: