Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
558f80e
v1
sdepassio Apr 25, 2025
1982bbf
update
sdepassio Apr 28, 2025
aecc3f5
metric + status
sdepassio Apr 30, 2025
6cec196
add cache patch from https://github.com/centreon/centreon-stream-conn…
sdepassio Apr 30, 2025
7d6c6cd
update doc
sdepassio Apr 30, 2025
db9b57b
removing unneeded params
sdepassio Apr 30, 2025
d2a24b7
add lua-sql-mysql dependency
sdepassio Apr 30, 2025
3cf7bd2
add the ability to upload the packages as artifacts
sdepassio Apr 30, 2025
e6665d8
update lib version
sdepassio Apr 30, 2025
1baf5e4
update release
sdepassio Apr 30, 2025
19da298
updates after client tests
sdepassio May 12, 2025
45438a8
Add the ability to provide an artifact name
sdepassio May 12, 2025
c530adc
Works for customer
sdepassio May 13, 2025
e858279
use broker v2 API
sdepassio May 13, 2025
d0ab0cf
Removal of sending metrics without metric_id
sdepassio May 15, 2025
5dd6d13
Remove debug code
vuntz May 15, 2025
60a53d2
updates after review
sdepassio May 22, 2025
e6115f7
update error message
sdepassio May 22, 2025
9ddd860
update retry for incomplete metrics (every 10 seconds) + clean logs +…
sdepassio May 22, 2025
6e64f43
reduce times
sdepassio May 22, 2025
73add7b
Add installation/removing test for stream connectors library package …
sdepassio May 26, 2025
4710662
fix add noble
sdepassio May 26, 2025
f1e4c3a
fix yaml-lint
sdepassio May 26, 2025
36b64fd
update: tests before delivery
sdepassio May 26, 2025
ba0bbb8
update
sdepassio May 26, 2025
8e2fe19
fix
sdepassio May 26, 2025
91fa93c
add centreon repo for tests
sdepassio May 26, 2025
b597e49
Add Centreon plugins repositories
sdepassio May 26, 2025
6ad2b36
fix plugins repo
sdepassio May 26, 2025
65e566d
updates for noble + dependencies and repo versions
sdepassio May 26, 2025
6fefbd5
fix yaml lint + test
sdepassio May 26, 2025
bfe3146
fix deb repos
sdepassio May 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/actions/deb-delivery/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,26 @@ inputs:
runs:
using: "composite"
steps:
- if: ${{ ! (inputs.distrib == 'jammy' && inputs.stability == 'stable') }}
- if: ${{ ! ((inputs.distrib == 'jammy' || inputs.distrib == 'noble') && inputs.stability == 'stable') }}
name: Use cache DEB files
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ./*.deb
key: ${{ inputs.cache_key }}
fail-on-cache-miss: true

- if: ${{ ! (inputs.distrib == 'jammy' && inputs.stability == 'stable') }}
- if: ${{ ! ((inputs.distrib == 'jammy' || inputs.distrib == 'noble') && inputs.stability == 'stable') }}
uses: jfrog/setup-jfrog-cli@901bb9632db90821c2d3f076012bdeaf66598555 # v3.4.1
env:
JF_URL: https://centreon.jfrog.io
JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }}

- if: ${{ ! (inputs.distrib == 'jammy' && inputs.stability == 'stable') }}
- if: ${{ ! ((inputs.distrib == 'jammy' || inputs.distrib == 'noble') && inputs.stability == 'stable') }}
name: Publish DEBs
run: |
FILES="*.deb"
if [[ "${{ inputs.distrib }}" == "jammy" ]]; then
if [[ "${{ inputs.distrib }}" == "jammy" || "${{ inputs.distrib }}" == "noble" ]]; then
REPO_PREFIX="ubuntu"
else
REPO_PREFIX="apt"
Expand Down
26 changes: 23 additions & 3 deletions .github/actions/package-nfpm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ inputs:
stability:
description: "Branch stability (stable, testing, unstable, canary)"
required: true
artifact_name:
description: The name of the uploaded artifact
required: false

runs:
using: composite
Expand Down Expand Up @@ -80,6 +83,12 @@ runs:
export RPM_SIGNING_KEY_ID="$RPM_GPG_SIGNING_KEY_ID"
export NFPM_RPM_PASSPHRASE="$RPM_GPG_SIGNING_PASSPHRASE"

luacurl_version="0.3.13-10"
if [[ ${{ inputs.distrib }} == "jammy" ]] || [[ ${{ inputs.distrib }} == "noble" ]]; then
luacurl_version="0.3.0-9"
fi
export LUA_CURL_VERSION="$luacurl_version"

for FILE in ${{ inputs.nfpm_file_pattern }}; do
DIRNAME=$(dirname $FILE)
BASENAME=$(basename $FILE)
Expand All @@ -98,11 +107,22 @@ runs:
path: ./*.${{ inputs.package_extension }}
key: ${{ inputs.cache_key }}

# Update if condition to true to get packages as artifacts
- if: ${{ false }}
# Add to your PR the label upload-artifacts to get packages as artifacts
- if: ${{ contains(github.event.pull_request.labels.*.name, 'upload-artifacts') }}
name: Get artifact name
id: get-artifact-name
run: |
if [ -z "${{ inputs.artifact_name }}" ]; then
echo "artifact_name=packages-${{ inputs.distrib }}" >> $GITHUB_OUTPUT
else
echo "artifact_name=${{ inputs.artifact_name }}" >> $GITHUB_OUTPUT
fi
shell: bash

- if: ${{ contains(github.event.pull_request.labels.*.name, 'upload-artifacts') }}
name: Upload package artifacts
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: packages-${{ inputs.distrib }}
name: ${{ steps.get-artifact-name.outputs.artifact_name }}
path: ./*.${{ inputs.package_extension}}
retention-days: 1
156 changes: 156 additions & 0 deletions .github/actions/test-packaged-library/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: "test-cpan-libs"
description: "Test packaged CPAN libraries"
inputs:
package_extension:
description: "The package extension (deb or rpm)"
required: true
distrib:
description: "The distribution name"
required: true
arch:
description: "The architecture (amd64 or arm64)"
required: true

runs:
using: "composite"
steps:
- name: Set environment variable
run: |
# Set Centreon version as an environment variable
version="24.10"
if [[ "${{ inputs.distrib }}" == "bullseye" ]]; then
version="24.04"
fi
echo "CENTREON_VERSION=${version}" >> $GITHUB_ENV
shell: bash

- if: ${{ inputs.package_extension == 'rpm' }}
name: Install zstd and Centreon repositories
run: |
dnf install -y zstd epel-release 'dnf-command(config-manager)'
dnf config-manager --set-enabled powertools || true # alma 8
dnf config-manager --set-enabled crb || true # alma 9
# Import Centreon GPG key
GPG_KEY_URL="https://yum-gpg.centreon.com/RPM-GPG-KEY-CES"
curl -sSL $GPG_KEY_URL -o RPM-GPG-KEY-CES
rpm --import RPM-GPG-KEY-CES
# Add Centreon repository
dnf -y config-manager --add-repo https://packages.centreon.com/rpm-standard/${{ env.CENTREON_VERSION }}/${{ inputs.distrib }}/centreon-${{ env.CENTREON_VERSION }}.repo
dnf -y clean all --enablerepo=*
# Add Centreon plugins repository
cat <<EOF >> /etc/yum.repos.d/centreon-plugins.repo
[centreon-plugins-stable]
name=centreon plugins stable x86_64
baseurl=https://packages.centreon.com/rpm-plugins/${{ inputs.distrib }}/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES
[centreon-plugins-stable-noarch]
name=centreon plugins stable noarch
baseurl=https://packages.centreon.com/rpm-plugins/${{ inputs.distrib }}/stable/noarch
enabled=1
gpgcheck=1
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES
[centreon-plugins-testing]
name=centreon plugins testing x86_64
baseurl=https://packages.centreon.com/rpm-plugins/${{ inputs.distrib }}/testing/x86_64
enabled=1
gpgcheck=1
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES
[centreon-plugins-testing-noarch]
name=centreon plugins testing noarch
baseurl=https://packages.centreon.com/rpm-plugins/${{ inputs.distrib }}/testing/noarch
enabled=1
gpgcheck=1
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES
[centreon-plugins-unstable]
name=centreon plugins unstable x86_64
baseurl=https://packages.centreon.com/rpm-plugins/${{ inputs.distrib }}/unstable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES
[centreon-plugins-unstable-noarch]
name=centreon plugins unstable noarch
baseurl=https://packages.centreon.com/rpm-plugins/${{ inputs.distrib }}/unstable/noarch
enabled=1
gpgcheck=1
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES
EOF
dnf -y update
shell: bash

- if: ${{ inputs.package_extension == 'deb' }}
name: Install zstd and Centreon repositories
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y zstd wget gpg apt-utils procps build-essential
wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1
# Set Centreon repository prefix based on distribution
repo="apt"
if [[ "${{ inputs.distrib }}" == "jammy" || "${{ inputs.distrib }}" == "noble" ]]; then
repo="ubuntu"
fi
# Add Centreon repositories
echo "deb https://packages.centreon.com/${repo}-standard-${{ env.CENTREON_VERSION }}-stable/ ${{ inputs.distrib }} main" | tee /etc/apt/sources.list.d/centreon.list
echo "deb https://packages.centreon.com/${repo}-standard-${{ env.CENTREON_VERSION }}-testing/ ${{ inputs.distrib }} main" | tee -a /etc/apt/sources.list.d/centreon.list
echo "deb https://packages.centreon.com/${repo}-standard-${{ env.CENTREON_VERSION }}-unstable/ ${{ inputs.distrib }} main" | tee -a /etc/apt/sources.list.d/centreon.list
# Add Centreon plugins repositories
echo "deb https://packages.centreon.com/${repo}-plugins-stable/ ${{ inputs.distrib }} main" | tee /etc/apt/sources.list.d/centreon-plugins.list
echo "deb https://packages.centreon.com/${repo}-plugins-testing/ ${{ inputs.distrib }} main" | tee -a /etc/apt/sources.list.d/centreon-plugins.list
echo "deb https://packages.centreon.com/${repo}-plugins-unstable/ ${{ inputs.distrib }} main" | tee -a /etc/apt/sources.list.d/centreon-plugins.list
apt-get update
shell: bash

- name: Restore package from cache
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ./*.${{ inputs.package_extension }}
key: ${{ github.sha }}-${{ github.run_id }}-${{ inputs.package_extension }}-${{ inputs.distrib }}
fail-on-cache-miss: true

- if: ${{ inputs.package_extension == 'rpm' }}
name: Check package installation / uninstallation
run: |
error_log="install_error_${{ inputs.distrib }}_${{ inputs.arch }}.log"
for package in ./*.rpm; do
echo "Installing package: $package"
# Install package, then uninstall it with all his dependencies
echo "Package installation..."
error_output=$(dnf install -y $package 2>&1) || { echo "$error_output" >> $error_log; echo "Error during installation of the package $package" >> $error_log; true; }
echo "Package installation done."
echo "Package uninstallation..."
error_output=$(dnf autoremove --setopt=keepcache=True -y $(echo $package | sed 's/_[0-9].*\.rpm//' | sed 's/.\///') 2>&1) || { echo "$error_output" >> $error_log; echo "Error during autoremove of the package $package" >> $error_log; true; }
echo "Package uninstallation done."
done
# If the file error_log exists and is not empty, the workflow is in error
if [[ -s $error_log ]]; then
cat $error_log
exit 1
fi
shell: bash

- if: ${{ inputs.package_extension == 'deb' }}
name: Check packages installation / uninstallation
run: |
error_log="install_error_${{ inputs.distrib }}_${{ inputs.arch }}.log"
for package in ./*.deb; do
# If the debian package name ends with amd64 or arm64, we only install it if the tested architecture is the same, otherwise we skip it
if [[ $package == *amd64.deb && ${{ inputs.arch }} != "amd64" || $package == *arm64.deb && ${{ inputs.arch }} != "arm64" ]]; then
continue
fi
echo "Installing package: $package"
# Install package, then uninstall it with all his dependencies
echo "Package installation..."
error_output=$(apt-get install -y $package 2>&1) || { echo "$error_output" >> $error_log; echo "Error during installation of the package $package" >> $error_log; true; }
echo "Package installation done."
echo "Package uninstallation..."
error_output=$(apt-get autoremove -y --purge $(echo $package | sed 's/_[0-9].*\.deb//' | sed 's/.\///') 2>&1) || { echo "$error_output" >> $error_log; echo "Error during autoremove of the package $package" >> $error_log; true; }
echo "Package uninstallation done."
done
# If the file error_log exists and is not empty, the workflow is in error
if [[ -s $error_log ]]; then
cat $error_log
exit 1
fi
shell: bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ARG REGISTRY_URL

FROM ${REGISTRY_URL}/ubuntu:noble

Check warning on line 3 in .github/docker/Dockerfile.packaging-stream-connectors-nfpm-noble

View workflow job for this annotation

GitHub Actions / dockerize (noble)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ${REGISTRY_URL}/ubuntu:noble results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

RUN bash -e <<EOF

apt-get update
apt-get install -y git zstd ca-certificates lua5.3 liblua5.3-dev

echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list

apt-get update
apt-get install -y nfpm=2.35.2

apt-get clean

EOF
2 changes: 1 addition & 1 deletion .github/workflows/docker-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

strategy:
matrix:
distrib: [alma8, alma9, bullseye, bookworm, jammy]
distrib: [alma8, alma9, bullseye, bookworm, jammy, noble]
steps:
- name: Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/lua-cffi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
distrib: [el8, el9, bullseye, bookworm, jammy]
distrib: [el8, el9, bullseye, bookworm, jammy, noble]
include:
- package_extension: rpm
image: packaging-stream-connectors-nfpm-alma8
Expand All @@ -43,8 +43,11 @@ jobs:
- package_extension: deb
image: packaging-stream-connectors-nfpm-jammy
distrib: jammy
- package_extension: deb
image: packaging-stream-connectors-nfpm-noble
distrib: noble

runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

container:
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
Expand Down Expand Up @@ -115,7 +118,7 @@ jobs:
deliver-rpm:
if: ${{ contains(fromJson('["unstable", "testing", "stable"]'), needs.get-environment.outputs.stability) }}
needs: [get-environment, package]
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
distrib: [el8, el9]
Expand All @@ -137,10 +140,10 @@ jobs:
deliver-deb:
if: ${{ contains(fromJson('["unstable", "testing", "stable"]'), needs.get-environment.outputs.stability) }}
needs: [get-environment, package]
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
distrib: [bullseye, bookworm, jammy]
distrib: [bullseye, bookworm, jammy, noble]
name: deliver ${{ matrix.distrib }}

steps:
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/lua-tz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
distrib: [el8, el9, bullseye, bookworm, jammy]
distrib: [el8, el9, bullseye, bookworm, jammy, noble]
include:
- package_extension: rpm
image: packaging-stream-connectors-nfpm-alma8
Expand All @@ -43,8 +43,11 @@ jobs:
- package_extension: deb
image: packaging-stream-connectors-nfpm-jammy
distrib: jammy
- package_extension: deb
image: packaging-stream-connectors-nfpm-noble
distrib: noble

runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

container:
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
Expand Down Expand Up @@ -88,7 +91,7 @@ jobs:
deliver-rpm:
if: ${{ contains(fromJson('["unstable", "testing", "stable"]'), needs.get-environment.outputs.stability) }}
needs: [get-environment, package]
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
distrib: [el8, el9]
Expand All @@ -110,10 +113,10 @@ jobs:
deliver-deb:
if: ${{ contains(fromJson('["unstable", "testing", "stable"]'), needs.get-environment.outputs.stability) }}
needs: [get-environment, package]
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
distrib: [bullseye, bookworm, jammy]
distrib: [bullseye, bookworm, jammy, noble]
name: deliver ${{ matrix.distrib }}

steps:
Expand Down
Loading
Loading