From 9086b5a251f6f5c9e64060a23c5ee88c04856743 Mon Sep 17 00:00:00 2001 From: "Eduardo Ramos Testillano (eramedu)" Date: Tue, 14 Apr 2020 19:24:04 +0200 Subject: [PATCH] Allow provide variant to builder with docker Release by default, and also Debug are supported. --- README.md | 2 +- docker-images/anna-build-nodb/deps/build.sh | 3 ++- tools/build-with-docker | 8 +++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2ab6c14..27d8115 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ You could use my pre-commit specific template if you want to do some basic check Architectures 'x86_64' and 'armv7l' are supported. Execute: - > tools/build-with-docker + > tools/build-with-docker [variant: [Release]|Debug] Note: database resources building is unsupported at the moment using docker. diff --git a/docker-images/anna-build-nodb/deps/build.sh b/docker-images/anna-build-nodb/deps/build.sh index 253e3d2..b47f4f5 100755 --- a/docker-images/anna-build-nodb/deps/build.sh +++ b/docker-images/anna-build-nodb/deps/build.sh @@ -3,7 +3,8 @@ if [ -x ./`basename $0` ] then exec ./`basename $0` $@ else - cmake -DSKIP_DATABASE_BUILD=1 $@ . + VARIANT=${VARIANT:-Release} + cmake -DSKIP_DATABASE_BUILD=1 -DCMAKE_BUILD_TYPE=${VARIANT} $@ . make -j `grep processor /proc/cpuinfo | wc -l` $2 #make doc fi diff --git a/tools/build-with-docker b/tools/build-with-docker index e0227ac..f649209 100755 --- a/tools/build-with-docker +++ b/tools/build-with-docker @@ -7,6 +7,8 @@ REPO_DIR="$(git rev-parse --show-toplevel 2>/dev/null)" [ -z "$REPO_DIR" ] && { echo "You must execute under a valid git repository !" ; exit 1 ; } +VARIANT=${1:-Release} + ############# # FUNCTIONS # ############# @@ -36,11 +38,15 @@ build_image() { # EXECUTION # ############# +echo +echo "Remember usage: $0 [variant: Release|Debug], Release by default" +echo + TAG=$(${REPO_DIR}/tools/version) # Build compilation image: build_image ${REPO_DIR}/docker-images/anna-build-nodb # this image has neither oracle nor mysql installed # Build source with previous compilation image: -docker run --rm -it -u $(id -u):$(id -g) -v ${REPO_DIR}:/code -w /code anna-build-nodb:${TAG} +docker run --rm -it -u $(id -u):$(id -g) -e VARIANT=${VARIANT} -v ${REPO_DIR}:/code -w /code anna-build-nodb:${TAG} -- 2.20.1