diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 0271975d..a05566b8 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -239,6 +239,26 @@ jobs: docker.io/library/ubuntu:22.04 /bin/bash -x /repos/monitoring-plugins/build/ubuntu2204/build.sh ${{ inputs.package-version || github.ref_name }} ${{ inputs.package-iteration || '1' }} + build-ubuntu2404: + runs-on: + - 'rhel8' + - 'self-hosted' + needs: + - 'prepare' + + steps: + + - name: 'mkdir ${{ env.BASE_DIR }}/build/ubuntu2404' + run: 'mkdir ${{ env.BASE_DIR }}/build/ubuntu2404' + + - name: 'Build for Ubuntu 24.04' + run: |- + podman run --interactive --rm \ + --mount type=bind,source=${{ env.BASE_DIR }}/build/ubuntu2404,destination=/build,relabel=private \ + --mount type=bind,source=${{ env.BASE_DIR }}/repos,destination=/repos,relabel=shared,ro=true \ + docker.io/library/ubuntu:24.04 /bin/bash -x /repos/monitoring-plugins/build/ubuntu2404/build.sh ${{ inputs.package-version || github.ref_name }} ${{ inputs.package-iteration || '1' }} + + # this would not work on the GitHub-hosted runners, as each job is isolated there, # but works when self-hosted (since there are no parallel jobs) upload-outputs: diff --git a/.github/workflows/linux-test-packages.yml b/.github/workflows/linux-test-packages.yml index cf0dd925..9fa8979f 100644 --- a/.github/workflows/linux-test-packages.yml +++ b/.github/workflows/linux-test-packages.yml @@ -233,6 +233,27 @@ jobs: docker.io/library/ubuntu:22.04 /bin/bash -x /repos/monitoring-plugins/testing/ubuntu/run-all + test-ubuntu2404: + runs-on: + - 'rhel8' + - 'self-hosted' + needs: + - 'prepare' + + steps: + + - name: 'mkdir ${{ env.BASE_DIR }}/output/ubuntu2404' + run: 'mkdir ${{ env.BASE_DIR }}/output/ubuntu2404' + + - name: 'Test on Ubuntu 24.04' + run: |- + podman run --interactive --rm \ + --mount type=bind,source=${{ env.BASE_DIR }}/output/ubuntu2404,destination=/output,relabel=private \ + --mount type=bind,source=${{ env.BASE_DIR }}/repos,destination=/repos,relabel=shared,ro=true \ + --mount type=bind,source=${{ env.BASE_DIR }}/monitoring-plugins-linux-packages/ubuntu2404,destination=/packages,relabel=shared,ro=true \ + docker.io/library/ubuntu:24.04 /bin/bash -x /repos/monitoring-plugins/testing/ubuntu/run-all + + # this would not work on the GitHub-hosted runners, as each job is isolated there, # but works when self-hosted (since there are no parallel jobs) upload-outputs: diff --git a/build/ubuntu2404/build.sh b/build/ubuntu2404/build.sh new file mode 100644 index 00000000..fb6d9c15 --- /dev/null +++ b/build/ubuntu2404/build.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +set -e + +PACKAGE_VERSION="$1" # version number has to start with a digit, for example 2023123101; "main" for the latest development version +PACKAGE_ITERATION="$2" # 2, if there is a bugfix for this package (not for the mp) + + +apt-get -y update +apt-get -y install git +apt-get -y install python3-venv python3-pip + +# dependencies for gem / fpm +apt-get install -y ruby ruby-dev rubygems build-essential + +# install fpm using gem +gem install fpm + +# prepare venv +. /repos/monitoring-plugins/build/shared/venv.sh + +# compile using pyinstaller +. /repos/monitoring-plugins/build/shared/compile.sh + +# prepare files for fpm +. /repos/monitoring-plugins/build/shared/prepare-fpm.sh + +# create packages using fpm +cd /tmp/fpm/check-plugins +fpm --output-type deb +cp *.deb /build/ + +cd /tmp/fpm/notification-plugins +fpm --output-type deb +cp *.deb /build/