Allow provide variant to builder with docker
authorEduardo Ramos Testillano (eramedu) <eduardo.ramos.testillano@ericsson.com>
Tue, 14 Apr 2020 17:24:04 +0000 (19:24 +0200)
committerEduardo Ramos Testillano (eramedu) <eduardo.ramos.testillano@ericsson.com>
Fri, 17 Apr 2020 19:28:08 +0000 (21:28 +0200)
Release by default, and also Debug are supported.

README.md
docker-images/anna-build-nodb/deps/build.sh
tools/build-with-docker

index 2ab6c14..27d8115 100644 (file)
--- 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.
 
index 253e3d2..b47f4f5 100755 (executable)
@@ -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
index e0227ac..f649209 100755 (executable)
@@ -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}