mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-15 15:32:04 +00:00
build: always check the BUILD_TYPE within the entrypoint
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
This commit is contained in:
parent
ebcb133f00
commit
c61c0e7020
@ -18,8 +18,8 @@
|
|||||||
language: cpp
|
language: cpp
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
env:
|
env:
|
||||||
- BUILD_TYPE=Debug
|
- BUILD_TYPE=debug
|
||||||
- BUILD_TYPE=Release
|
- BUILD_TYPE=release
|
||||||
sudo: required
|
sudo: required
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
|
@ -7,6 +7,16 @@ BUILD_DIR=/build
|
|||||||
CMD=${1:-usage}
|
CMD=${1:-usage}
|
||||||
shift
|
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
|
case "$CMD" in
|
||||||
"cmake")
|
"cmake")
|
||||||
# Check that source directory contains Falco and Sysdig
|
# Check that source directory contains Falco and Sysdig
|
||||||
@ -18,15 +28,6 @@ case "$CMD" in
|
|||||||
echo "Missing falco source." >&2
|
echo "Missing falco source." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
# Prepare build directory
|
||||||
mkdir -p "$BUILD_DIR/$BUILD_TYPE"
|
mkdir -p "$BUILD_DIR/$BUILD_TYPE"
|
||||||
cd "$BUILD_DIR/$BUILD_TYPE"
|
cd "$BUILD_DIR/$BUILD_TYPE"
|
||||||
@ -48,6 +49,10 @@ case "$CMD" in
|
|||||||
exec "$CMD" "$@"
|
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"
|
cd "$BUILD_DIR/$BUILD_TYPE"
|
||||||
make -j"$MAKE_JOBS" "$CMD"
|
make -j"$MAKE_JOBS" "$CMD"
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user