Skip to content

Commit

Permalink
Merge pull request #559 from greenbone/y0urself/fix-docker-ci-21.4
Browse files Browse the repository at this point in the history
[21.04] Fix and integrate the new Dockerimage stucture into 21.04
  • Loading branch information
y0urself authored Jul 7, 2021
2 parents bfb8e95 + cb57616 commit 849da74
Show file tree
Hide file tree
Showing 8 changed files with 185 additions and 224 deletions.
26 changes: 26 additions & 0 deletions .docker/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Dockerfile for gvm-libs-$VERSION-$COMPILER-build

# Define ARG we use through the build
ARG VERSION=master
ARG BUILD_TYPE=Debug
ARG COMPILER=gcc

FROM greenbone/gvm-libs-$VERSION-$COMPILER-testing

# This will make apt-get install without question
ARG DEBIAN_FRONTEND=noninteractive

# Define ARG we use through the build
ARG VERSION
ARG BUILD_TYPE
ARG COMPILER

COPY . /usr/local/src/gvm-libs
WORKDIR /usr/local/src

# clone and install gvm-libs
RUN cd gvm-libs && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. && \
make install
44 changes: 0 additions & 44 deletions .docker/deploy/clang/Dockerfile

This file was deleted.

44 changes: 0 additions & 44 deletions .docker/deploy/gcc/Dockerfile

This file was deleted.

56 changes: 0 additions & 56 deletions .docker/test/clang/Dockerfile

This file was deleted.

57 changes: 0 additions & 57 deletions .docker/test/gcc/Dockerfile

This file was deleted.

81 changes: 81 additions & 0 deletions .docker/testing/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Dockerfile for gvm-libs-$VERSION-$COMPILER-testing

# Define ARG we use through the build
ARG VERSION=master
ARG BUILD_TYPE=Debug
ARG COMPILER=gcc

# Use '-slim' image for reduced image size
FROM debian:buster-slim

# This will make apt-get install without question
ARG DEBIAN_FRONTEND=noninteractive

# Redefine ARG we use through the build
ARG VERSION
ARG BUILD_TYPE
ARG COMPILER

WORKDIR /usr/local/src

# Install core dependencies required for building and testing gvm-libs
RUN apt-get update \
&& apt-get install --no-install-recommends --assume-yes \
ca-certificates \
cmake \
git \
libglib2.0-dev \
libgnutls28-dev \
libgpgme-dev \
libhiredis-dev \
libpcap-dev \
libssh-gcrypt-dev \
libxml2-dev \
libnet1-dev \
make \
pkg-config \
uuid-dev \
libssl-dev \
lcov \
&& rm -rf /var/lib/apt/lists/*

# Install gcc/g++ compiler
RUN if ( test "$COMPILER" = "gcc"); then \
echo "Compiler is $COMPILER" \
&& apt-get update \
&& apt-get install --no-install-recommends --assume-yes gcc g++; \
fi

# Install clang compiler
RUN if ( test "$COMPILER" = "clang"); then \
echo "Compiler is $COMPILER" \
&& apt-get update \
&& apt-get install --no-install-recommends --assume-yes \
clang \
clang-format \
clang-tools; \
fi

# clone and install mqtt paho
# workaround otherwise paho.mqtt.c creates man1 as a file
RUN if ( test "$VERSION" = "master" || test "$VERSION" = "middleware" ); then \
echo "Verion is $VERSION" \
&& mkdir /usr/local/share/man/man1 \
&& git clone --depth 1 https://github.com/eclipse/paho.mqtt.c \
&& cd paho.mqtt.c \
&& make \
&& make install \
&& cd .. \
&& rm -rf paho.mqtt.c; \
fi

# & install cgreen for unit tests
RUN git clone --depth 1 https://github.com/cgreen-devs/cgreen.git \
&& cd cgreen \
&& make \
&& make test \
&& make install \
&& cd .. \
&& rm -rf cgreen

ENV LD_LIBRARY_PATH="/usr/local/lib"
12 changes: 6 additions & 6 deletions .github/workflows/ci-c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jobs:
strategy:
matrix:
container:
- greenbone/gvm-libs-gvm-libs-21.04-debian-buster-clang-test
- greenbone/gvm-libs-gvm-libs-21.04-debian-buster-gcc-test
- greenbone/gvm-libs-21.04-clang-testing
- greenbone/gvm-libs-21.04-gcc-testing
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v2.3.4
- name: Configure and test gvm-libs
run: |
mkdir build && cd build/ && cmake -DCMAKE_BUILD_TYPE=Release \
mkdir build && cd build/ && cmake -DCMAKE_BUILD_TYPE=Debug \
-DBUILD_TESTS=1 .. && make install && make tests && \
CTEST_OUTPUT_ON_FAILURE=1 make test
working-directory: ${{ github.WORKSPACE }}
Expand All @@ -42,8 +42,8 @@ jobs:
strategy:
matrix:
container:
- greenbone/gvm-libs-gvm-libs-21.04-debian-buster-clang-test
- greenbone/gvm-libs-gvm-libs-21.04-debian-buster-gcc-test
- greenbone/gvm-libs-21.04-clang-testing
- greenbone/gvm-libs-21.04-gcc-testing
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v2.3.4
Expand All @@ -56,7 +56,7 @@ jobs:
scan_build:
name: Scan-build gvm-libs with clang
runs-on: 'ubuntu-latest'
container: greenbone/gvm-libs-gvm-libs-21.04-debian-buster-clang-test
container: greenbone/gvm-libs-21.04-clang-testing
steps:
- uses: actions/checkout@v2.3.4
- name: Configure and Compile gvm-libs
Expand Down
Loading

0 comments on commit 849da74

Please sign in to comment.