Skip to content

Commit

Permalink
Add: gvm-libs debian testing
Browse files Browse the repository at this point in the history
Adds a new image for gvm-libs based on debian:testing

The tags for that are:

- testing - releases
- testing-edge - any change

That way we can buy some time for adjusting our workflow for new debian
releases.
  • Loading branch information
Kraemii committed Jul 11, 2023
1 parent a23e090 commit c6911f2
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 2 deletions.
56 changes: 56 additions & 0 deletions .docker/prod-testing.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
ARG VERSION=unstable
# this allows to work on forked repository
ARG REPOSITORY=greenbone/gvm-libs
FROM debian:testing-slim AS build
ARG DEBIAN_FRONTEND=noninteractive

# Install
COPY . /source
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
curl \
cmake \
pkg-config \
gnupg \
libglib2.0-dev \
libgpgme-dev \
libgnutls28-dev \
uuid-dev \
libssh-gcrypt-dev \
libhiredis-dev \
libxml2-dev \
libpcap-dev \
libnet1-dev \
libldap2-dev \
libradcli-dev \
libpaho-mqtt-dev \
libcgreen1-dev \
lcov \
&& rm -rf /var/lib/apt/lists/*
RUN cmake -DCMAKE_BUILD_TYPE=Release -B/build /source
RUN DESTDIR=/install cmake --build /build -- install

FROM debian:testing-slim

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y --no-install-recommends \
libglib2.0-0 \
libgpgme11 \
libgnutls30 \
libuuid1 \
libssh-gcrypt-4 \
libhiredis0.14 \
libxml2 \
libpcap0.8 \
libnet1 \
libldap-common \
libradcli4 \
libpaho-mqtt1.3 \
&& rm -rf /var/lib/apt/lists/*

COPY --from=build /install/ /

RUN ldconfig
32 changes: 30 additions & 2 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
# set this tag to latest and stable
echo "IS_LATEST_TAG=true" >> $GITHUB_ENV
fi
- name: "Setup meta information (IS_VERSION_TAG: ${{ env.IS_VERSION_TAG }}, IS_LATEST_TAG: ${{ env.IS_LATEST_TAG }} )"
- name: "Setup meta information debian:stable"
id: meta
uses: docker/metadata-action@v4
with:
Expand Down Expand Up @@ -82,7 +82,8 @@ jobs:
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: "Setup meta information (IS_VERSION_TAG: ${{ env.IS_VERSION_TAG }}, IS_LATEST_TAG: ${{ env.IS_LATEST_TAG }} )"

- name: "Setup meta information debian:oldstable"
id: old_stable_meta
uses: docker/metadata-action@v4
with:
Expand All @@ -109,6 +110,33 @@ jobs:
tags: ${{ steps.old_stable_meta.outputs.tags }}
labels: ${{ steps.old_stable_meta.outputs.labels }}

- name: "Setup meta information debian:testing"
id: testing_meta
uses: docker/metadata-action@v4
with:
images: ${{ github.repository }}
labels: |
org.opencontainers.image.vendor=Greenbone
org.opencontainers.image.base.name=debian:testing-slim
flavor: latest=false # no auto latest container tag for git tags
tags: |
# for the images provided for debian:testing we just provide
# testing on an new version or testing-edge when it is on main.
# testing-branch-sha on a branch
type=raw,value=testing,enable=${{ env.IS_LATEST_TAG }}
type=raw,value=testing-edge,enable=${{ github.ref_name == 'main' }}
type=raw,value=testing-{{branch}}-{{sha}},enable=${{ github.ref_type == 'branch' && github.event_name == 'push' && github.ref_name != 'main' }}
type=ref,event=pr
- name: Build and push Container image
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' && (github.ref_type == 'tag' || github.ref_name == 'main') }}
file: .docker/prod-testing.Dockerfile
platforms: linux/amd64,linux/arm64
tags: ${{ steps.testing_meta.outputs.tags }}
labels: ${{ steps.testing_meta.outputs.labels }}

# triggers projects that work with stable branches on a new stable tag
trigger-stable-projects:
needs: production
Expand Down

0 comments on commit c6911f2

Please sign in to comment.