Skip to content

Commit

Permalink
chore(ci/cd): improve build
Browse files Browse the repository at this point in the history
markuslf committed Jan 26, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 9fafb40 commit 87f67a8
Showing 3 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lf-linux-build.yml
Original file line number Diff line number Diff line change
@@ -32,9 +32,9 @@ on:
default: 'debian11,debian12,rocky8,rocky9,ubuntu2004,ubuntu2204,ubuntu2404'

check-plugin:
description: 'If you only want to compile a specific check plugin, specify its name, for example `xml`.'
description: 'If you only want to compile a specific check plugin, specify its name, for example `xml`, otherwise use `all`.'
required: false
default: '*'
default: 'all'

arch:
description: 'Architecture. `X64` or `ARM64`.'
@@ -126,7 +126,7 @@ jobs:
/repos/monitoring-plugins/build/${{ matrix.distro }}/build.sh
${{ inputs.package-version || github.ref_name }}
${{ inputs.package-iteration || '1' }}
${{ inputs.check-plugin || '*' }}
${{ inputs.check-plugin || 'all' }}
# this would not work on the GitHub-hosted runners, as each job is isolated there,
14 changes: 7 additions & 7 deletions .github/workflows/lf-linux-test.yml
Original file line number Diff line number Diff line change
@@ -88,7 +88,7 @@ jobs:
run: 'mkdir ${{ env.BASE_DIR }}/output/debian11'

- name: 'Test on Debian 11'
if: env.exists == 'true'
if: "env.exists == 'true'"
run: |-
podman run --interactive --rm \
--mount type=bind,source=${{ env.BASE_DIR }}/output/debian11,destination=/output,relabel=private \
@@ -124,7 +124,7 @@ jobs:
run: 'mkdir ${{ env.BASE_DIR }}/output/debian12'

- name: 'Test on RHEL8'
if: env.exists == 'true'
if: "env.exists == 'true'"
run: |-
podman run --interactive --rm \
--mount type=bind,source=${{ env.BASE_DIR }}/output/debian12,destination=/output,relabel=private \
@@ -161,7 +161,7 @@ jobs:
run: 'mkdir ${{ env.BASE_DIR }}/output/rocky8'

- name: 'Test on RHEL8'
if: env.exists == 'true'
if: "env.exists == 'true'"
run: |-
podman run --interactive --rm \
--mount type=bind,source=${{ env.BASE_DIR }}/output/rocky8,destination=/output,relabel=private \
@@ -197,7 +197,7 @@ jobs:
run: 'mkdir ${{ env.BASE_DIR }}/output/rocky9'

- name: 'Test on RHEL8'
if: env.exists == 'true'
if: "env.exists == 'true'"
run: |-
podman run --interactive --rm \
--mount type=bind,source=${{ env.BASE_DIR }}/output/rocky9,destination=/output,relabel=private \
@@ -234,7 +234,7 @@ jobs:
run: 'mkdir ${{ env.BASE_DIR }}/output/ubuntu2004'

- name: 'Test on Ubuntu 20.04'
if: env.exists == 'true'
if: "env.exists == 'true'"
run: |-
podman run --interactive --rm \
--mount type=bind,source=${{ env.BASE_DIR }}/output/ubuntu2004,destination=/output,relabel=private \
@@ -270,7 +270,7 @@ jobs:
run: 'mkdir ${{ env.BASE_DIR }}/output/ubuntu2204'

- name: 'Test on Ubuntu 22.04'
if: env.exists == 'true'
if: "env.exists == 'true'"
run: |-
podman run --interactive --rm \
--mount type=bind,source=${{ env.BASE_DIR }}/output/ubuntu2204,destination=/output,relabel=private \
@@ -306,7 +306,7 @@ jobs:
run: 'mkdir ${{ env.BASE_DIR }}/output/ubuntu2404'

- name: 'Test on Ubuntu 24.04'
if: env.exists == 'true'
if: "env.exists == 'true'"
run: |-
podman run --interactive --rm \
--mount type=bind,source=${{ env.BASE_DIR }}/output/ubuntu2404,destination=/output,relabel=private \
4 changes: 4 additions & 0 deletions build/shared/shared.sh
Original file line number Diff line number Diff line change
@@ -7,6 +7,9 @@ compile_plugins() {
return 1
fi
CHECK_PLUGIN="$2"
if [ "$CHECK_PLUGIN" == "all" ]; then
CHECK_PLUGIN="*"
fi

mkdir -p /tmp/output/summary/{check,notification}-plugins

@@ -27,6 +30,7 @@ compile_plugins() {
\cp --archive --no-clobber /tmp/output/check-plugins/*.dist/* /tmp/output/summary/check-plugins

if [ "$CHECK_PLUGIN" == "*" ]; then
# only build notification plugins if all check plugins should be built
for dir in "$MONITORING_PLUGINS_DIR"/notification-plugins/*; do
notification="$(basename "$dir")"
if [ "$notification" != "example" ]; then

0 comments on commit 87f67a8

Please sign in to comment.