diff --git a/.circleci/config.yml b/.circleci/config.yml index 50a43dc7..9d816bf4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,17 +59,20 @@ jobs: # execute integration tests based on the build results coming from the "build/centos7" job "tests/integration": docker: - - image: falcosecurity/falco-tester:latest + - image: falcosecurity/falco-tester:dynamic-builds # todo(fntlnz): replace this with the actual image once PR #968 is merged + environment: + SOURCE_DIR: "/source" + BUILD_DIR: "/build" + BUILD_TYPE: "release" steps: + - setup_remote_docker - checkout: path: /source/falco - attach_workspace: at: / - run: name: execute integration tests - command: | - ls -la / - ls -la /build + command: /usr/bin/entrypoint test workflows: version: 2 build_and_test: diff --git a/docker/tester/root/usr/bin/entrypoint b/docker/tester/root/usr/bin/entrypoint index daab479c..eb8fac3e 100755 --- a/docker/tester/root/usr/bin/entrypoint +++ b/docker/tester/root/usr/bin/entrypoint @@ -24,7 +24,11 @@ case "$CMD" in exit 1 fi if [ -z "$FALCO_VERSION" ]; then - echo "Missing Falco version." >&2 + echo "Automatically figuring out Falco version." + FALCO_VERSION=$($BUILD_DIR/$BUILD_TYPE/userspace/falco/falco --version | cut -d' ' -f3 | tr -d '\r') + fi + if [ -z "$FALCO_VERSION" ]; then + echo "Falco version cannot be guessed, please provide it with the FALCO_VERSION environment variable." >&2 exit 1 fi PACKAGE="$BUILD_DIR/$BUILD_TYPE/falco-$FALCO_VERSION-x86_64.deb" @@ -54,4 +58,4 @@ case "$CMD" in "usage") exec "$CMD" "$@" ;; -esac \ No newline at end of file +esac diff --git a/scripts/build b/scripts/build index 6c70f6ad..d0216ef8 100755 --- a/scripts/build +++ b/scripts/build @@ -23,4 +23,4 @@ docker run \ -v "$BUILD_DIR":/build \ -e BUILD_TYPE="$BUILD_TYPE" \ -e FALCO_VERSION="$CURRENT_FALCO_VERSION" \ - "$FALCOTESTER_IMAGE" test \ No newline at end of file + "$FALCOTESTER_IMAGE" test