build: falco tester automatic version

Signed-off-by: Lorenzo Fontana <lo@linux.com>
This commit is contained in:
Lorenzo Fontana 2020-01-15 14:29:10 +01:00 committed by Leo Di Donato
parent 14337670a5
commit b8335b510d
3 changed files with 14 additions and 7 deletions

View File

@ -59,17 +59,20 @@ jobs:
# execute integration tests based on the build results coming from the "build/centos7" job # execute integration tests based on the build results coming from the "build/centos7" job
"tests/integration": "tests/integration":
docker: 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: steps:
- setup_remote_docker
- checkout: - checkout:
path: /source/falco path: /source/falco
- attach_workspace: - attach_workspace:
at: / at: /
- run: - run:
name: execute integration tests name: execute integration tests
command: | command: /usr/bin/entrypoint test
ls -la /
ls -la /build
workflows: workflows:
version: 2 version: 2
build_and_test: build_and_test:

View File

@ -24,7 +24,11 @@ case "$CMD" in
exit 1 exit 1
fi fi
if [ -z "$FALCO_VERSION" ]; then 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 exit 1
fi fi
PACKAGE="$BUILD_DIR/$BUILD_TYPE/falco-$FALCO_VERSION-x86_64.deb" PACKAGE="$BUILD_DIR/$BUILD_TYPE/falco-$FALCO_VERSION-x86_64.deb"