diff --git a/.travis.yml b/.travis.yml index 9bb192f3..f136011b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,8 +18,8 @@ language: cpp compiler: gcc env: - - BUILD_TYPE=Debug - - BUILD_TYPE=Release + - BUILD_TYPE=debug + - BUILD_TYPE=release sudo: required services: - docker diff --git a/docker/builder/root/usr/bin/entrypoint b/docker/builder/root/usr/bin/entrypoint index e8d38df1..4e76ff6a 100755 --- a/docker/builder/root/usr/bin/entrypoint +++ b/docker/builder/root/usr/bin/entrypoint @@ -7,6 +7,16 @@ BUILD_DIR=/build CMD=${1:-usage} shift +# Build type can be "debug" or "release", fallbacks to "release" by default +BUILD_TYPE=$(echo "$BUILD_TYPE" | tr "[:upper:]" "[:lower:]") +case "$BUILD_TYPE" in +"debug") +;; +*) +BUILD_TYPE="release" +;; +esac + case "$CMD" in "cmake") # Check that source directory contains Falco and Sysdig @@ -18,15 +28,6 @@ case "$CMD" in echo "Missing falco source." >&2 exit 1 fi - # Build type can be "debug" or "release", fallbacks to "release" by default - BUILD_TYPE=$(echo "$BUILD_TYPE" | tr "[:upper:]" "[:lower:]") - case "$BUILD_TYPE" in - "debug") - ;; - *) - BUILD_TYPE="release" - ;; - esac # Prepare build directory mkdir -p "$BUILD_DIR/$BUILD_TYPE" cd "$BUILD_DIR/$BUILD_TYPE" @@ -48,6 +49,10 @@ case "$CMD" in exec "$CMD" "$@" ;; *) + if [ ! -d "$BUILD_DIR/$BUILD_TYPE" ]; then + echo "Missing $BUILD_DIR/$BUILD_TYPE directory: run cmake." + exit 1 + fi cd "$BUILD_DIR/$BUILD_TYPE" make -j"$MAKE_JOBS" "$CMD" ;;