Skip to content

Commit

Permalink
build: circleci config for musl
Browse files Browse the repository at this point in the history
Co-Authored-By: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
  • Loading branch information
fntlnz and leogr committed Sep 2, 2020
1 parent fc38338 commit 430ba2b
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
version: 2
jobs:
# Build a statically linked Falco release binary using musl
# This build is 100% static, there are no host dependencies
"build/musl":
docker:
- image: alpine:3.12
working_directory: /source-static/falco
steps:
- checkout:
path: /source-static/falco
- run:
name: Update base image
command: apk update -y
- run:
name: Install build dependencies
command: apk add g++ gcc cmake cmake make ncurses-dev git bash perl linux-headers autoconf automake m4 libtool elfutils-dev libelf-static patch binutils -y
- run:
name: Prepare project
command: |
mkdir -p /build-static/release
pushd /build-static/release
cmake -DCPACK_GENERATOR=TGZ -DBUILD_BPF=Off -DBUILD_DRIVER=Off -DCMAKE_BUILD_TYPE=Release -DUSE_BUNDLED_DEPS=On -DMUSL_OPTIMIZED_BUILD=On ..
popd
- run:
name: Build
command: |
pushd /build-static/release
make -j4 all
popd
- run:
name: Package
command: |
pushd /build-static/release
make -j4 package
popd
- run:
name: Run unit tests
command: |
pushd /build-static/release
make tests
popd
- persist_to_workspace:
root: /
paths:
- /build-static/release
- source-static
# Build using ubuntu LTS
# This build is dynamic, most dependencies are taken from the OS
"build/ubuntu-focal":
Expand Down Expand Up @@ -202,6 +247,20 @@ jobs:
- run:
name: Execute integration tests
command: /usr/bin/entrypoint test
"tests/integration-static":
docker:
- image: falcosecurity/falco-tester:latest
environment:
SOURCE_DIR: "/source-static"
BUILD_DIR: "/build-static"
BUILD_TYPE: "release"
steps:
- setup_remote_docker
- attach_workspace:
at: /
- run:
name: Execute integration tests
command: /usr/bin/entrypoint test
"tests/driver-loader/integration":
machine:
image: ubuntu-1604:202004-01
Expand Down Expand Up @@ -271,6 +330,11 @@ jobs:
command: |
FALCO_VERSION=$(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
jfrog bt u /build/release/falco-${FALCO_VERSION}-x86_64.tar.gz falcosecurity/bin-dev/falco/${FALCO_VERSION} x86_64/ --user poiana --key ${BINTRAY_SECRET} --publish --override
- run:
name: Publish tgz-static-dev
command: |
FALCO_VERSION=$(cat /build-musl/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
jfrog bt u /build-musl/release/falco-${FALCO_VERSION}-x86_64.tar.gz falcosecurity/bin-dev/falco/${FALCO_VERSION} x86_64/ falco-static-${FALCO_VERSION}-x86_64.tar.gz --user poiana --key ${BINTRAY_SECRET} --publish --override
# Publish docker packages
"publish/docker-dev":
docker:
Expand Down Expand Up @@ -372,6 +436,7 @@ workflows:
version: 2
build_and_test:
jobs:
- "build/musl"
- "build/ubuntu-focal"
- "build/ubuntu-focal-debug"
- "build/ubuntu-bionic"
Expand All @@ -381,6 +446,9 @@ workflows:
- "tests/integration":
requires:
- "build/centos7"
- "tests/integration-static":
requires:
- "build/musl"
- "tests/driver-loader/integration":
requires:
- "build/centos7"
Expand All @@ -402,6 +470,7 @@ workflows:
only: master
requires:
- "rpm/sign"
- "tests/integration-static"
- "publish/docker-dev":
context: falco
filters:
Expand Down

0 comments on commit 430ba2b

Please sign in to comment.