Skip to content

Commit

Permalink
ci/cd: add ubuntu2404
Browse files Browse the repository at this point in the history
  • Loading branch information
NavidSassan committed May 30, 2024
1 parent 6e004f7 commit 5b0276c
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/linux-test-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
35 changes: 35 additions & 0 deletions build/ubuntu2404/build.sh
Original file line number Diff line number Diff line change
@@ -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/

0 comments on commit 5b0276c

Please sign in to comment.