Skip to content

Commit 563aa73

Browse files
committed
chore(ci/cd): change linux packaging workflow to use native tools (rpmbuild, debuild)
1 parent c73f486 commit 563aa73

33 files changed

+472
-562
lines changed

.github/workflows/lf-build-linux-aarch64.yml

Lines changed: 11 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,17 @@ name: 'Linuxfabrik: Build Linux (aarch64)'
33
on:
44
workflow_dispatch:
55
inputs:
6-
compile-plugins:
7-
description: 'Space-separated list of check plugins to compile and package, for example "cpu-usage feed scanrootkit". Leave empty to build all plugins.'
8-
required: false
9-
default: ''
106
target-distros:
117
description: 'Space-separated list of operating systems to compile on and build packages for. Supported: `debian11 debian12 rocky8 rocky9 ubuntu2004 ubuntu2204 ubuntu2404`. Cannot be empty.'
128
required: true
139
default: 'debian11 debian12 rocky8 rocky9 ubuntu2004 ubuntu2204 ubuntu2404'
10+
version:
11+
description: 'Package Version'
12+
required: true
1413
package-iteration:
1514
description: 'The iteration number for the package (usually "1").'
1615
required: true
1716
default: '1'
18-
# lib-repo-ref:
19-
# description: 'The branch, tag, or SHA to checkout from the lib repo. Defaults to the current branch or tag.'
20-
# required: false
21-
# default: ''
2217

2318
# modify the default permissions granted to the GITHUB_TOKEN
2419
permissions:
@@ -68,7 +63,7 @@ jobs:
6863
- name: 'Set environment variables for the build scripts'
6964
run: |
7065
echo "LFMP_ARCH=aarch64" >> $GITHUB_ENV
71-
echo "LFMP_COMPILE_PLUGINS=${{ github.event.inputs.compile-plugins }}" >> $GITHUB_ENV
66+
echo "LFMP_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
7267
echo "LFMP_PACKAGE_ITERATION=${{ github.event.inputs.package-iteration }}" >> $GITHUB_ENV
7368
7469
# Each matrix job gets one distro value here (to parallelize job runs and avoiding Github's 6h timeout).
@@ -77,63 +72,35 @@ jobs:
7772
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
7873
7974
echo "LFMP_DIR_REPOS=$GITHUB_WORKSPACE/repos" >> $GITHUB_ENV
80-
echo "LFMP_DIR_COMPILED=$RUNNER_TEMP/lfmp/compiled" >> $GITHUB_ENV
75+
echo "LFMP_DIR_REPO_MP=$GITHUB_WORKSPACE/repos/monitoring-plugins" >> $GITHUB_ENV
8176
echo "LFMP_DIR_PACKAGED=$RUNNER_TEMP/lfmp/packaged" >> $GITHUB_ENV
8277
8378
- name: 'Create working directories'
8479
run: |
8580
mkdir -p $LFMP_DIR_REPOS
86-
mkdir -p $LFMP_DIR_COMPILED
8781
mkdir -p $LFMP_DIR_PACKAGED
8882
8983
- name: 'git clone https://github.com/Linuxfabrik/THIS-REPO'
9084
uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # v4.2.2
9185
with:
92-
path: '${{ env.LFMP_DIR_REPOS }}/monitoring-plugins'
86+
path: '${{ env.LFMP_DIR_REPO_MP }}'
9387

94-
- name: 'Fetch the current version from Github'
95-
run: >
96-
/bin/bash
97-
$LFMP_DIR_REPOS/monitoring-plugins/build/get-latest-version.sh
9888

9989
- name: 'Debug'
10090
run: >
10191
/bin/bash
102-
$LFMP_DIR_REPOS/monitoring-plugins/build/debug.sh
92+
$LFMP_DIR_REPO_MP/build/debug.sh
10393
10494
- name: 'Install podman'
10595
run: >
10696
/bin/bash
107-
$LFMP_DIR_REPOS/monitoring-plugins/build/install-podman.sh
108-
109-
- name: 'For each distro compile the specified plugins'
110-
run: >
111-
/bin/bash
112-
$LFMP_DIR_REPOS/monitoring-plugins/build/matrix-compile.sh
113-
114-
- name: 'Install FPM, the packaging tool'
115-
run: >
116-
/bin/bash
117-
$LFMP_DIR_REPOS/monitoring-plugins/build/install-fpm.sh
97+
$LFMP_DIR_REPO_MP/build/install-podman.sh
11898
119-
- name: 'Create the fpm files'
99+
- name: 'For each distro create package'
120100
run: >
121-
/bin/bash
122-
$LFMP_DIR_REPOS/monitoring-plugins/build/create-fpms.sh
123-
124-
- name: 'Create the packages for every OS'
125-
run: >
126-
/bin/bash
127-
$LFMP_DIR_REPOS/monitoring-plugins/build/create-packages.sh
128-
129-
- name: 'Upload the compiled plugins'
130-
uses: 'actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02' # v4.6.2
131-
with:
132-
compression-level: 8
133-
path: '${{ env.LFMP_DIR_COMPILED }}/*'
134-
name: "lfmp-${{ env.LFMP_VERSION }}-${{ env.LFMP_PACKAGE_ITERATION }}.compiled.${{ env.LFMP_ARCH }}.${{ env.LFMP_TARGET_DISTROS }}"
101+
/bin/bash $LFMP_DIR_REPO_MP/build/matrix-package.sh
135102
136-
- name: 'Upload the packages (rpm, deb, tar, zip)'
103+
- name: 'Upload the packages (rpm, deb)'
137104
uses: 'actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02' # v4.6.2
138105
with:
139106
compression-level: 8

.github/workflows/lf-build-linux-x86_64.yml

Lines changed: 11 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,17 @@ name: 'Linuxfabrik: Build Linux (x86_64)'
33
on:
44
workflow_dispatch:
55
inputs:
6-
compile-plugins:
7-
description: 'Space-separated list of check plugins to compile and package, for example "cpu-usage feed scanrootkit". Leave empty to build all plugins.'
8-
required: false
9-
default: ''
106
target-distros:
117
description: 'Space-separated list of operating systems to compile on and build packages for. Supported: `debian11 debian12 rocky8 rocky9 ubuntu2004 ubuntu2204 ubuntu2404`. Cannot be empty.'
128
required: true
139
default: 'debian11 debian12 rocky8 rocky9 ubuntu2004 ubuntu2204 ubuntu2404'
10+
version:
11+
description: 'Package Version'
12+
required: true
1413
package-iteration:
1514
description: 'The iteration number for the package (usually "1").'
1615
required: true
1716
default: '1'
18-
# lib-repo-ref:
19-
# description: 'The branch, tag, or SHA to checkout from the lib repo. Defaults to the current branch or tag.'
20-
# required: false
21-
# default: ''
2217

2318
# modify the default permissions granted to the GITHUB_TOKEN
2419
permissions:
@@ -68,7 +63,7 @@ jobs:
6863
- name: 'Set environment variables for the build scripts'
6964
run: |
7065
echo "LFMP_ARCH=x86_64" >> $GITHUB_ENV
71-
echo "LFMP_COMPILE_PLUGINS=${{ github.event.inputs.compile-plugins }}" >> $GITHUB_ENV
66+
echo "LFMP_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
7267
echo "LFMP_PACKAGE_ITERATION=${{ github.event.inputs.package-iteration }}" >> $GITHUB_ENV
7368
7469
# Each matrix job gets one distro value here (to parallelize job runs and avoiding Github's 6h timeout).
@@ -77,63 +72,35 @@ jobs:
7772
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
7873
7974
echo "LFMP_DIR_REPOS=$GITHUB_WORKSPACE/repos" >> $GITHUB_ENV
80-
echo "LFMP_DIR_COMPILED=$RUNNER_TEMP/lfmp/compiled" >> $GITHUB_ENV
75+
echo "LFMP_DIR_REPO_MP=$GITHUB_WORKSPACE/repos/monitoring-plugins" >> $GITHUB_ENV
8176
echo "LFMP_DIR_PACKAGED=$RUNNER_TEMP/lfmp/packaged" >> $GITHUB_ENV
8277
8378
- name: 'Create working directories'
8479
run: |
8580
mkdir -p $LFMP_DIR_REPOS
86-
mkdir -p $LFMP_DIR_COMPILED
8781
mkdir -p $LFMP_DIR_PACKAGED
8882
8983
- name: 'git clone https://github.com/Linuxfabrik/THIS-REPO'
9084
uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # v4.2.2
9185
with:
92-
path: '${{ env.LFMP_DIR_REPOS }}/monitoring-plugins'
86+
path: '${{ env.LFMP_DIR_REPO_MP }}'
9387

94-
- name: 'Fetch the current version from Github'
95-
run: >
96-
/bin/bash
97-
$LFMP_DIR_REPOS/monitoring-plugins/build/get-latest-version.sh
9888

9989
- name: 'Debug'
10090
run: >
10191
/bin/bash
102-
$LFMP_DIR_REPOS/monitoring-plugins/build/debug.sh
92+
$LFMP_DIR_REPO_MP/build/debug.sh
10393
10494
- name: 'Install podman'
10595
run: >
10696
/bin/bash
107-
$LFMP_DIR_REPOS/monitoring-plugins/build/install-podman.sh
108-
109-
- name: 'For each distro compile the specified plugins'
110-
run: >
111-
/bin/bash
112-
$LFMP_DIR_REPOS/monitoring-plugins/build/matrix-compile.sh
113-
114-
- name: 'Install FPM, the packaging tool'
115-
run: >
116-
/bin/bash
117-
$LFMP_DIR_REPOS/monitoring-plugins/build/install-fpm.sh
97+
$LFMP_DIR_REPO_MP/build/install-podman.sh
11898
119-
- name: 'Create the fpm files'
99+
- name: 'For each distro create package'
120100
run: >
121-
/bin/bash
122-
$LFMP_DIR_REPOS/monitoring-plugins/build/create-fpms.sh
123-
124-
- name: 'Create the packages for every OS'
125-
run: >
126-
/bin/bash
127-
$LFMP_DIR_REPOS/monitoring-plugins/build/create-packages.sh
128-
129-
- name: 'Upload the compiled plugins'
130-
uses: 'actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02' # v4.6.2
131-
with:
132-
compression-level: 8
133-
path: '${{ env.LFMP_DIR_COMPILED }}/*'
134-
name: "lfmp-${{ env.LFMP_VERSION }}-${{ env.LFMP_PACKAGE_ITERATION }}.compiled.${{ env.LFMP_ARCH }}.${{ env.LFMP_TARGET_DISTROS }}"
101+
/bin/bash $LFMP_DIR_REPO_MP/build/matrix-package.sh
135102
136-
- name: 'Upload the packages (rpm, deb, tar, zip)'
103+
- name: 'Upload the packages (rpm, deb)'
137104
uses: 'actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02' # v4.6.2
138105
with:
139106
compression-level: 8

.github/workflows/lf-build-windows-x86_64.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ on:
1111
# description: 'Space-separated list of operating systems to compile on and build packages for. Supported: `windows`. Cannot be empty.'
1212
# required: true
1313
# default: 'windows'
14+
version:
15+
description: 'Package Version'
16+
required: true
1417
package-iteration:
1518
description: 'The iteration number for the package (usually "1").'
1619
required: true
1720
default: '1'
18-
# lib-repo-ref:
19-
# description: 'The branch, tag, or SHA to checkout from the lib repo. Defaults to the current branch or tag.'
20-
# required: false
21-
# default: ''
2221

2322
# modify the default permissions granted to the GITHUB_TOKEN
2423
permissions:
@@ -40,6 +39,7 @@ jobs:
4039
echo "LFMP_ARCH=x86_64" >> $GITHUB_ENV
4140
echo "LFMP_COMPILE_PLUGINS=${{ github.event.inputs.compile-plugins }}" >> $GITHUB_ENV
4241
echo "LFMP_PACKAGE_ITERATION=${{ github.event.inputs.package-iteration }}" >> $GITHUB_ENV
42+
echo "LFMP_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
4343
# echo "LFMP_TARGET_DISTROS=${{ github.event.inputs.target-distros }}" >> $GITHUB_ENV
4444
4545
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
@@ -60,12 +60,6 @@ jobs:
6060
with:
6161
path: '${{ env.LFMP_DIR_REPOS }}/monitoring-plugins'
6262

63-
- name: 'Fetch the current version from Github'
64-
shell: 'bash'
65-
run: >
66-
/bin/bash
67-
$LFMP_DIR_REPOS/monitoring-plugins/build/get-latest-version.sh
68-
6963
- name: 'Debug'
7064
shell: 'bash'
7165
run: >

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ MANIFEST
3030
# Usually these files are written by a python script from a template
3131
# before PyInstaller builds the exe, so as to inject date/other infos into it.
3232
*.manifest
33-
*.spec
33+
#*.spec
3434

3535
# Installer logs
3636
pip-log.txt
@@ -131,3 +131,4 @@ dmypy.json
131131
.~lock.*
132132

133133
/icingaweb2-module-director-basket.json
134+
/packaged

0 commit comments

Comments
 (0)