From 4b70ba726dff32ef2267f275d53aa93f96ba92e1 Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Wed, 12 Mar 2025 17:27:30 +0100 Subject: [PATCH 01/11] wip --- .github/workflows/perl-cpan-libraries.yml | 43 ++++++++++++----------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/.github/workflows/perl-cpan-libraries.yml b/.github/workflows/perl-cpan-libraries.yml index 887f9fb62c..6516e0046e 100644 --- a/.github/workflows/perl-cpan-libraries.yml +++ b/.github/workflows/perl-cpan-libraries.yml @@ -172,23 +172,24 @@ jobs: name: Get package infos id: package-infos run: | - cpan_info=$(cpanm --info ${{ matrix.name }}) + cpan_info=$(curl https://fastapi.metacpan.org/v1/module/${{ matrix.name }}) if [ -z "${{ matrix.version }}" ]; then - CPAN_PACKAGE_VERSION=$(echo $cpan_info | sed 's/\.tar\.gz$//' | sed 's/.*\-//') - if [[ ! $CPAN_PACKAGE_VERSION =~ ^[v0-9]+\.[0-9]+ ]]; then - echo "::error::Invalid version number: ${CPAN_PACKAGE_VERSION}" - exit 1 - fi - PACKAGE_VERSION="${CPAN_PACKAGE_VERSION}" + PACKAGE_VERSION=$(echo $cpan_info | jq -r '.version') else PACKAGE_VERSION="${{ matrix.version }}" fi echo "package_version=$(echo $PACKAGE_VERSION)" >> $GITHUB_OUTPUT - CPAN_PACKAGE_NAME=$(echo $cpan_info | sed 's/.*\///g' | sed 's/-[0-9\.]*\.tar\.gz//g') + CPAN_PACKAGE_NAME=$(echo $cpan_info | jq -r '.distribution') PACKAGE_NAME="perl-$CPAN_PACKAGE_NAME" echo "package_name=$(echo $PACKAGE_NAME)" >> $GITHUB_OUTPUT shell: bash + - if: ${{ contains(matrix.build_distribs, matrix.distrib) }} + uses: jfrog/setup-jfrog-cli@f748a0599171a192a2668afee8d0497f7c1069df # v4.5.6 + env: + JF_URL: https://centreon.jfrog.io + JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }} + - if: ${{ contains(matrix.build_distribs, matrix.distrib) }} name: Check if package already exists id: check-package-existence @@ -205,6 +206,11 @@ jobs: do_not_build="false" fi fi + if [[ "$do_not_build" == "false" ]]; then + # Check if the package exists in the Centreon repository + artifactory_lib=$(jf rt search --sort-by updated --sort-order desc --limit 1 "rpm-plugins/${{ matrix.distrib }}/stable/x86_64/RPMS/**/${{ steps.package-infos.outputs.package_name }}-${{ steps.package-infos.outputs.package_version }}-*.rpm") + + fi echo "do_not_build=$do_not_build" >> $GITHUB_OUTPUT shell: bash @@ -488,30 +494,29 @@ jobs: id: package-infos run: | apt-get update - cpan_info=$(cpanm --info ${{ matrix.name }}) + cpan_info=$(curl https://fastapi.metacpan.org/v1/module/${{ matrix.name }}) if [ -z "${{ matrix.version }}" ]; then - CPAN_PACKAGE_VERSION=$(echo $cpan_info | sed 's/\.tar\.gz$//' | sed 's/.*\-//') - if [[ ! $CPAN_PACKAGE_VERSION =~ ^[v0-9]+\.[0-9]+ ]]; then - echo "::error::Invalid version number: ${CPAN_PACKAGE_VERSION}" - exit 1 - fi - PACKAGE_VERSION="${CPAN_PACKAGE_VERSION}" + PACKAGE_VERSION=$(echo $cpan_info | jq -r '.version') else PACKAGE_VERSION="${{ matrix.version }}" fi echo "package_version=$(echo $PACKAGE_VERSION)" >> $GITHUB_OUTPUT - CPAN_PACKAGE_NAME=$(echo $cpan_info | sed 's/.*\///g' | sed 's/-[0-9\.]*\.tar\.gz//g' | tr '[:upper:]' '[:lower:]') - + CPAN_PACKAGE_NAME=$(echo $cpan_info | jq -r '.distribution' | tr '[:upper:]' '[:lower:]') # Handle specific cases of libssh-session if [[ "$CPAN_PACKAGE_NAME" == "lib"* ]];then PACKAGE_NAME="$CPAN_PACKAGE_NAME-perl" else PACKAGE_NAME="lib$CPAN_PACKAGE_NAME-perl" fi - echo "package_name=$(echo $PACKAGE_NAME)" >> $GITHUB_OUTPUT shell: bash + - if: ${{ contains(matrix.build_distribs, matrix.distrib) }} + uses: jfrog/setup-jfrog-cli@f748a0599171a192a2668afee8d0497f7c1069df # v4.5.6 + env: + JF_URL: https://centreon.jfrog.io + JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }} + - if: ${{ contains(matrix.build_names, matrix.build_name) }} name: Check if package already exists id: check-package-existence @@ -550,7 +555,6 @@ jobs: if [ "${{ matrix.no-auto-depends }}" == "true" ]; then PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --no-auto-depends" fi - if [ -z "${{ matrix.deb_provides }}" ]; then PACKAGE_PROVIDES="" else @@ -568,7 +572,6 @@ jobs: else created_package=$(fpm -s cpan -t ${{ matrix.package_extension }} --deb-dist ${{ matrix.distrib }} --iteration ${{ matrix.revision }}${{ steps.parse-distrib.outputs.package_distrib_separator }}${{ steps.parse-distrib.outputs.package_distrib_name }} --verbose --cpan-verbose --no-cpan-test$PACKAGE_DEPENDENCIES$PACKAGE_PROVIDES -v ${{ steps.package-infos.outputs.package_version }} ${{ matrix.name }} | tee "$temp_file" | grep "Created package" | grep -oP '(?<=:path=>").*?(?=")') || { echo "Error: fpm command failed"; exit 1; } fi - # Check package name if [ -z "$created_package" ]; then echo "Error: fpm command failed" From 8e36b532c099fe5af52e914bda4f620b5f0869af Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Mon, 31 Mar 2025 09:22:00 +0200 Subject: [PATCH 02/11] removing unneeded versions --- .github/workflows/perl-cpan-libraries.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/perl-cpan-libraries.yml b/.github/workflows/perl-cpan-libraries.yml index 6516e0046e..9b94874d1c 100644 --- a/.github/workflows/perl-cpan-libraries.yml +++ b/.github/workflows/perl-cpan-libraries.yml @@ -115,10 +115,6 @@ jobs: revision: "2" - name: "DateTime::Format::Duration::ISO8601" rpm_provides: "perl(DateTime-Format-Duration-ISO8601)" - - name: "Device::Modbus::RTU::Client" - version: "0.022" - - name: "Device::Modbus::TCP::Client" - version: "0.026" - name: "FFI::CheckLib" rpm_dependencies: "perl(Env)" - name: "FFI::Platypus" @@ -143,8 +139,6 @@ jobs: build_distribs: el9 - name: "Statistics::Descriptive" build_distribs: el9 - - name: "Statistics::Regression" - version: "0.53" - name: "URL::Encode::XS" build_distribs: el9 - name: "UUID" @@ -154,7 +148,6 @@ jobs: - name: "ZMQ::FFI" rpm_dependencies: "zeromq" - name: "ZMQ::LibZMQ4" - version: "0.01" rpm_dependencies: "zeromq" name: package ${{ matrix.distrib }} ${{ matrix.name }} @@ -465,10 +458,8 @@ jobs: no-auto-depends: "true" - name: "Statistics::Regression" build_names: "bullseye-amd64" - version: "0.53" - name: "ZMQ::LibZMQ4" use_dh_make_perl: "false" - version: "0.01" deb_dependencies: "libzmq5" build_names: "bullseye-amd64,bookworm,jammy,noble,bullseye-arm64" name: package ${{ matrix.distrib }} ${{ matrix.arch }} ${{ matrix.name }} From bb2a0271dda7dd4c21f14f47a40f027123ba298c Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Mon, 31 Mar 2025 09:22:34 +0200 Subject: [PATCH 03/11] start new workflow --- .github/workflows/perl-cpan-libraries-new.yml | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 .github/workflows/perl-cpan-libraries-new.yml diff --git a/.github/workflows/perl-cpan-libraries-new.yml b/.github/workflows/perl-cpan-libraries-new.yml new file mode 100644 index 0000000000..659a845a89 --- /dev/null +++ b/.github/workflows/perl-cpan-libraries-new.yml @@ -0,0 +1,161 @@ +name: perl-cpan-libraries-new + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +on: + workflow_dispatch: + pull_request: + paths: + - ".github/workflows/perl-cpan-libraries-new.yml" + push: + branches: + - develop + - dev-[2-9][0-9].[0-9][0-9].x + - master + - "[2-9][0-9].[0-9][0-9].x" + paths: + - ".github/workflows/perl-cpan-libraries-new.yml" + +jobs: + get-environment: + uses: ./.github/workflows/get-environment.yml + + libraries-check: + needs: [get-environment] + if: | + needs.get-environment.outputs.skip_workflow == 'false' && + needs.get-environment.outputs.stability != 'stable' + + strategy: + fail-fast: false + matrix: + distribution: [el8, el9, bullseye, bookworm, jammy, noble] + include: + - name: "ARGV::Struct" + - name: "Authen::SASL::SASLprep" + - name: "Authen::SCRAM::Client" + - name: "BSON" + rpm_provides: "perl(BSON::Bytes) perl(BSON::Code) perl(BSON::DBRef) perl(BSON::OID) perl(BSON::Raw) perl(BSON::Regex) perl(BSON::Time) perl(BSON::Timestamp) perl(BSON::Types) perl(BSON)" + - name: "BSON::XS" + - name: "Config::AWS" + - name: "Convert::Binary::C" + - name: "Convert::EBCDIC" + - name: "Crypt::Argon2" + preinstall_cpanlibs: "Dist::Build" + rpm_provides: "perl-Crypt-Argon2-debuginfo perl(Crypt::Argon2)" + deb_use_dh_make_perl: "false" + deb_no-auto-depends: "true" + deb_dependencies: "libexporter-tiny-perl libtime-hires-perl libxsloader-perl" + deb_provides: "libcrypt-argon2-perl-dbgsym" + deb_build_arm64: "true" + revision: "2" + - name: "Crypt::Blowfish_PP" + - name: "Crypt::OpenSSL::AES" + deb_use_dh_make_perl: "false" + deb_dependencies: "libexporter-tiny-perl libxs-install-perl" + deb_no-auto-depends: "true" + deb_build_arm64: "true" + - name: "DBD::Sybase" + - name: "DataStruct::Flat" + - name: "DateTime::Format::Duration::ISO8601" + rpm_provides: "perl(DateTime-Format-Duration-ISO8601)" + - name: "Device::Modbus" + - name: "Device::Modbus::RTU::Client" + - name: "Device::Modbus::TCP::Client" + - name: "Digest::SHA1" + - name: "Email::Send::SMTP::Gmail" + - name: "Exporter::Tiny" # Required by JSON::Path: the version available in the official repositories doesn't work with the last version of JSON::Path + - name: "FFI::CheckLib" + rpm_dependencies: "perl(Env)" + - name: "FFI::Platypus" + rpm_provides: "perl(FFI::Platypus::Buffer) perl(FFI::Platypus::Memory)" + rpm_dependencies: "perl(Capture::Tiny) perl(FFI::CheckLib) perl(File::Spec::Functions) perl(IPC::Cmd) perl(JSON::PP) perl(List::Util) perl(autodie) perl(constant) perl(parent)" + no-auto-depends: "true" + - name: "File::SearchPath" + - name: "HTTP::ProxyPAC" + - name: "Hash::Ordered" + - name: "JMX::Jmx4Perl" + - name: "JSON::Path" + - name: "LV" + - name: "Libssh::Session" + rpm_dependencies: "libssh" + rpm_provides: "perl-Libssh-Session-debuginfo perl(Libssh::Session) perl(Libssh::Sftp)" + deb_use_dh_make_perl: "false" + deb_no-auto-depends: "true" + deb_dependencies: "libcarp-assert-perl libdynaloader-functions-perl libexporter-tiny-perl libdevel-overloadinfo-perl libssh-4 libc6" + deb_provides: "libssh-session-perl-dbgsym libssh-session-sftp" + deb_build_arm64: "true" + revision: "2" + - name: "Mojo::IOLoop::Signal" + rpm_dependencies: "perl-Mojolicious" + rpm_provides: "perl(Mojo::IOLoop::Signal)" + no-auto-depends: "true" + - name: "MongoDB" + - name: "MooseX::ClassAttribute" + - name: "Net::Amazon::Signature::V4" + - name: "Net::Curl" + rpm_dependencies: "libcurl" + rpm_provides: "perl-Net-Curl-debuginfo perl(Net::Curl) perl(Net::Curl::Compat) perl(Net::Curl::Easy) perl(Net::Curl::Form) perl(Net::Curl::Multi) perl(Net::Curl::Share)" + deb_use_dh_make_perl: "false" + deb_no-auto-depends: "true" + deb_build_arm64: "true" + deb_dependencies: "libcarp-assert-perl libdynaloader-functions-perl libexporter-tiny-perl libdevel-overloadinfo-perl libcurl4" + deb_provides: "libnet-curl-perl-dbgsym libnet-curl-compat-perl libnet-curl-easy-perl libnet-curl-form-perl libnet-curl-share-perl libnet-curl-multi-perl" + revision: "2" + - name: "Net::DHCP" + rpm_provides: "perl(Net::DHCP::Constants) perl(Net::DHCP::Packet)" + - name: "Net::FTPSSL" + - name: "Net::HTTPTunnel" + - name: "Net::MQTT::Simple" + version: "1.29" + - name: "Net::NTP" + - name: "Net::SMTPS" + - name: "Net::SMTP_auth" + - name: "Net::Subnet" + - name: "Net::TFTP" + - name: "PBKDF2::Tiny" + - name: "Paws" + deb_use_dh_make_perl: "false" + deb_dependencies: "libmoose-perl libmoosex-classattribute-perl libjson-maybexs-perl liburl-encode-perl libargv-struct-perl libmoo-perl libtype-tiny-perl libdatastruct-flat-perl libmodule-find-perl libthrowable-perl liburi-template-perl libnet-amazon-signature-v4-perl" + deb_no-auto-depends: "true" + - name: "Statistics::Descriptive" + - name: "Statistics::Regression" + - name: "Term::Clui" + - name: "URI::Template" + - name: "URL::Encode" + - name: "URL::Encode::XS" + - name: "UUID" + version: "0.31" + - name: "UUID::URandom" + - name: "Unicode::Stringprep" + - name: "WWW::Selenium" + - name: "XML::LibXML::Simple" + - name: "XS::Loader" + - name: "ZMQ::Constants" + - name: "ZMQ::FFI" + rpm_dependencies: "zeromq" + - name: "ZMQ::LibZMQ4" + rpm_dependencies: "zeromq" + deb_build_arm64: "true" + deb_use_dh_make_perl: "false" + deb_dependencies: "libzmq5" + - distribution: el8 + image: almalinux:8 + - distribution: el9 + image: almalinux:9 + - distribution: bullseye + image: debian:bullseye + - distribution: bookworm + image: debian:bookworm + - distribution: jammy + image: ubuntu:jammy + - distribution: noble + image: ubuntu:noble + + runs-on: ubuntu-24.04 + + steps: + - name: Checkout sources + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 \ No newline at end of file From 7d3df743371eb5f9bf5286ce3277766b046c4112 Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Sat, 5 Apr 2025 01:17:00 +0200 Subject: [PATCH 04/11] add script to check if the lib has to be built, and generate a json file with the list of cpan libs that needs to be build for each distribution --- .github/datas/cpan-libraries.json | 265 ++++++++++++++++++ .github/scripts/get-cpan-libraires-list.sh | 123 ++++++++ .github/workflows/perl-cpan-libraries-new.yml | 140 ++------- 3 files changed, 419 insertions(+), 109 deletions(-) create mode 100644 .github/datas/cpan-libraries.json create mode 100755 .github/scripts/get-cpan-libraires-list.sh diff --git a/.github/datas/cpan-libraries.json b/.github/datas/cpan-libraries.json new file mode 100644 index 0000000000..5516b1c881 --- /dev/null +++ b/.github/datas/cpan-libraries.json @@ -0,0 +1,265 @@ +[ + { + "name": "ARGV::Struct" + }, + { + "name": "Authen::SASL::SASLprep" + }, + { + "name": "Authen::SCRAM::Client" + }, + { + "name": "BSON", + "rpm": { + "provides": "perl(BSON::Bytes) perl(BSON::Code) perl(BSON::DBRef) perl(BSON::OID) perl(BSON::Raw) perl(BSON::Regex) perl(BSON::Time) perl(BSON::Timestamp) perl(BSON::Types) perl(BSON)" + } + }, + { + "name": "BSON::XS" + }, + { + "name": "Config::AWS" + }, + { + "name": "Convert::Binary::C" + }, + { + "name": "Convert::EBCDIC" + }, + { + "name": "Crypt::Argon2", + "preinstall_cpanlibs": "Dist::Build", + "revision": "2", + "deb": { + "build_arm64": "true", + "dependencies": "libexporter-tiny-perl libtime-hires-perl libxsloader-perl", + "no_auto_depends": "true", + "provides": "libcrypt-argon2-perl-dbgsym", + "use_dh_make_perl": "false" + }, + "rpm": { + "provides": "perl-Crypt-Argon2-debuginfo perl(Crypt::Argon2)" + } + }, + { + "name": "Crypt::Blowfish_PP" + }, + { + "name": "Crypt::OpenSSL::AES", + "deb": { + "build_arm64": "true", + "dependencies": "libexporter-tiny-perl libxs-install-perl", + "no_auto_depends": "true", + "use_dh_make_perl": "false" + } + }, + { + "name": "DBD::Sybase" + }, + { + "name": "DataStruct::Flat" + }, + { + "name": "DateTime::Format::Duration::ISO8601", + "rpm": { + "provides": "perl(DateTime-Format-Duration-ISO8601)" + } + }, + { + "name": "Device::Modbus" + }, + { + "name": "Device::Modbus::RTU::Client" + }, + { + "name": "Device::Modbus::TCP::Client" + }, + { + "name": "Digest::SHA1" + }, + { + "name": "Email::Send::SMTP::Gmail" + }, + { + "name": "Exporter::Tiny", + "comment": "Required by JSON::Path: the version available in the official repositories doesn't work with the last version of JSON::Path" + }, + { + "name": "FFI::CheckLib", + "rpm": { + "dependencies": "perl(Env)" + } + }, + { + "name": "FFI::Platypus", + "rpm": { + "dependencies": "perl(Capture::Tiny) perl(FFI::CheckLib) perl(File::Spec::Functions) perl(IPC::Cmd) perl(JSON::PP) perl(List::Util) perl(autodie) perl(constant) perl(parent)", + "no_auto_depends": "true", + "provides": "perl(FFI::Platypus::Buffer) perl(FFI::Platypus::Memory)" + } + }, + { + "name": "File::SearchPath" + }, + { + "name": "HTTP::ProxyPAC" + }, + { + "name": "Hash::Ordered" + }, + { + "name": "JMX::Jmx4Perl" + }, + { + "name": "JSON::Path" + }, + { + "name": "LV" + }, + { + "name": "Libssh::Session", + "revision": "2", + "deb": { + "build_arm64": "true", + "dependencies": "libcarp-assert-perl libdynaloader-functions-perl libexporter-tiny-perl libdevel-overloadinfo-perl libssh-4 libc6", + "no_auto_depends": "true", + "provides": "libssh-session-perl-dbgsym libssh-session-sftp", + "use_dh_make_perl": "false" + }, + "rpm": { + "dependencies": "libssh", + "provides": "perl-Libssh-Session-debuginfo perl(Libssh::Session) perl(Libssh::Sftp)" + } + }, + { + "name": "Mojo::IOLoop::Signal", + "rpm": { + "dependencies": "perl-Mojolicious", + "no_auto_depends": "true", + "provides": "perl(Mojo::IOLoop::Signal)" + } + }, + { + "name": "MongoDB" + }, + { + "name": "MooseX::ClassAttribute" + }, + { + "name": "Net::Amazon::Signature::V4" + }, + { + "name": "Net::Curl", + "revision": "2", + "deb": { + "build_arm64": "true", + "dependencies": "libcarp-assert-perl libdynaloader-functions-perl libexporter-tiny-perl libdevel-overloadinfo-perl libcurl4", + "no_auto_depends": "true", + "provides": "libnet-curl-perl-dbgsym libnet-curl-compat-perl libnet-curl-easy-perl libnet-curl-form-perl libnet-curl-share-perl libnet-curl-multi-perl", + "use_dh_make_perl": "false" + }, + "rpm": { + "dependencies": "libcurl", + "provides": "perl-Net-Curl-debuginfo perl(Net::Curl) perl(Net::Curl::Compat) perl(Net::Curl::Easy) perl(Net::Curl::Form) perl(Net::Curl::Multi) perl(Net::Curl::Share)" + } + }, + { + "name": "Net::DHCP", + "rpm": { + "provides": "perl(Net::DHCP::Constants) perl(Net::DHCP::Packet)" + } + }, + { + "name": "Net::FTPSSL" + }, + { + "name": "Net::HTTPTunnel" + }, + { + "name": "Net::MQTT::Simple", + "version": "1.29" + }, + { + "name": "Net::NTP" + }, + { + "name": "Net::SMTPS" + }, + { + "name": "Net::SMTP_auth" + }, + { + "name": "Net::Subnet" + }, + { + "name": "Net::TFTP" + }, + { + "name": "PBKDF2::Tiny" + }, + { + "name": "Paws", + "deb": { + "dependencies": "libmoose-perl libmoosex-classattribute-perl libjson-maybexs-perl liburl-encode-perl libargv-struct-perl libmoo-perl libtype-tiny-perl libdatastruct-flat-perl libmodule-find-perl libthrowable-perl liburi-template-perl libnet-amazon-signature-v4-perl", + "no_auto_depends": "true", + "use_dh_make_perl": "false" + } + }, + { + "name": "Statistics::Descriptive" + }, + { + "name": "Statistics::Regression" + }, + { + "name": "Term::Clui" + }, + { + "name": "URI::Template" + }, + { + "name": "URL::Encode" + }, + { + "name": "URL::Encode::XS" + }, + { + "name": "UUID", + "version": "0.31" + }, + { + "name": "UUID::URandom" + }, + { + "name": "Unicode::Stringprep" + }, + { + "name": "WWW::Selenium" + }, + { + "name": "XML::LibXML::Simple" + }, + { + "name": "XS::Loader" + }, + { + "name": "ZMQ::Constants" + }, + { + "name": "ZMQ::FFI", + "rpm": { + "dependencies": "zeromq" + } + }, + { + "name": "ZMQ::LibZMQ4", + "deb": { + "build_arm64": "true", + "dependencies": "libzmq5", + "use_dh_make_perl": "false" + }, + "rpm": { + "dependencies": "zeromq" + } + } +] diff --git a/.github/scripts/get-cpan-libraires-list.sh b/.github/scripts/get-cpan-libraires-list.sh new file mode 100755 index 0000000000..4443fac0ea --- /dev/null +++ b/.github/scripts/get-cpan-libraires-list.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +# Parameters: +# $1: distribution type (debian or el) +# $2: distribution version (bullseye, buster, centos7, centos8, etc.) +distribution_type=$1 +distribution_version=$2 + +# Read JSON file +json_data=$(cat .github/datas/cpan-libraries.json) +# Temporary file to store the JSON data +temp_file=$(mktemp) + +add_json_object() { + # Parameters: + local cpan_lib_name="$1" + local package_name="$2" + local version="$3" + local revision="$4" + local fpm="$5" + local no_auto_depends="$6" + local depends="$7" + local provides="$8" + local preinstall_cpan_libs="$9" + + # Create a JSON object and add it to the temporary file + jq -n \ + --arg name "$cpan_lib_name" \ + --arg package_name "$package_name" \ + --arg version "$version" \ + --arg revision "$revision" \ + --arg fpm "$fpm" \ + --arg no_auto_depends "$no_auto_depends" \ + --arg depends "$depends" \ + --arg provides "$provides" \ + --arg preinstall_cpan_libs "$preinstall_cpan_libs" \ + '{name: $name, package_name: $package_name, version: $version, revision: $revision, fpm: $fpm, no_auto_depends: $no_auto_depends, depends: $depends, provides: $provides, preinstall_cpan_libs: $preinstall_cpan_libs}' >> "$temp_file" +} + +# Browse JSON data +echo "$json_data" | jq -c '.[]' | while read -r item; do + # Extract values using jq + name=$(echo "$item" | jq -r '.name') + version=$(echo "$item" | jq -r '.version') + revision=$(echo "$item" | jq -r '.revision') + preinstall_cpan_libs=$(echo "$item" | jq -r '.preinstall_cpanlibs') + if [ "$distribution_type" == "debian" ] || [ "$distribution_type" == "ubuntu" ]; then + if [ $(echo "$item" | jq -r '.deb.use_dh_make_perl') == "false" ]; then fpm="true"; else fpm="false"; fi + if [ $(echo "$item" | jq -r '.deb.no_auto_depends') == "true" ]; then no_auto_depends="true"; else no_auto_depends="false"; fi + depends=$(echo "$item" | jq -r '.deb.dependencies') + provides=$(echo "$item" | jq -r '.deb.provides') + elif [ "$distribution_type" == "el" ]; then + fpm="true" + if [ $(echo "$item" | jq -r '.rpm.no_auto_depends') == "true" ]; then no_auto_depends="true"; else no_auto_depends="false"; fi + depends=$(echo "$item" | jq -r '.rpm.dependencies') + provides=$(echo "$item" | jq -r '.rpm.provides') + fi + # Get library informations + cpan_info=$(curl -s https://fastapi.metacpan.org/v1/module/$name) + if [ "$version" == "null" ]; then + cpan_version=$(echo $cpan_info | jq -r '.version') + else + cpan_version="$version" + fi + if [ "$revision" == "null" ]; then + cpan_revision="1" + else + cpan_revision="$revision" + fi + cpan_distribution_name=$(echo $cpan_info | jq -r '.distribution') + # Check if exists on the official repository + # Check if the package exists in the official repository or the Centreon repository + if [ "$distribution_type" == "debian" ] || [ "$distribution_type" == "ubuntu" ]; then + # Get the informations of the package on Debian + package_name=$(echo lib$cpan_distribution_name-perl | tr '[:upper:]' '[:lower:]' | sed -E 's/_/-/g') + package_info=$(apt-cache policy $package_name) + package_candidate=$(echo "$package_info" | grep 'Candidate:' | awk '{print $2}') + package_version=$(echo "$package_candidate" | sed -E 's/([0-9.]+)[-+].*/\1/') + package_revision=$(echo "$package_candidate" | sed -E 's/.*[-](.*)$/\1/') + if echo $package_info | grep -q "deb.debian.org"; then + package_repository="debian" + elif echo $package_info | grep -q "ubuntu.com"; then + package_repository="ubuntu" + elif echo $package_info | grep -q "packages.centreon.com/apt-plugins-stable"; then + package_repository="centreon" + fi + elif [ "$distribution_type" == "el" ]; then + # Get the informations of the package on AlmaLinux + package_name=$(echo perl-$cpan_distribution_name) + package_info=$(dnf info $package_name) + package_version=$(echo "$package_info" | grep 'Version' | awk '{print $3}') + package_revision=$(echo "$package_info" | grep 'Release' | awk '{print $3}' | sed -E 's/([0-9]+).*/\1/') + package_repository=$(echo "$package_info" | grep 'Repository' | awk '{print $3}') + fi + #echo "APT - Name: $package_name, Version: $package_version, Revision: $package_revision, Repository: $package_repository" + # If the package exists in the official repository, and we don't need a specific version, we don't need to build it + # If the package exists in the Centreon repository in the same version and revision, we don't need to build it + if [ -n "$package_repository" ] && [ "$package_repository" != "centreon" ]; then + if [ "$version" == "null" ] || [ "$version" == "$package_version" ]; then + echo "Package $package_name already exists in the official repository, no need to build it" + add_json_object "$name" "$package_name" "$cpan_version" "$cpan_revision" "$fpm" "$no_auto_depends" "$depends" "$provides" "$preinstall_cpan_libs" + else + echo "Package $package_name already exists in the official repository, but we need a specific version, we need to build it" + add_json_object "$name" "$package_name" "$cpan_version" "$cpan_revision" "$fpm" "$no_auto_depends" "$depends" "$provides" "$preinstall_cpan_libs" + fi + elif [[ "$package_repository" =~ "centreon" ]]; then + if [ "$cpan_version" == "$package_version" ] && [ "$cpan_revision" == "$package_revision" ]; then + echo "Package $package_name already exists in the Centreon repository in the same version and revision, no need to build it" + add_json_object "$name" "$package_name" "$cpan_version" "$cpan_revision" "$fpm" "$no_auto_depends" "$depends" "$provides" "$preinstall_cpan_libs" + else + echo "Package $package_name already exists in the Centreon repository, but not in the same version/revision, we need to build it" + add_json_object "$name" "$package_name" "$cpan_version" "$cpan_revision" "$fpm" "$no_auto_depends" "$depends" "$provides" "$preinstall_cpan_libs" + fi + else + echo "Package $package_name does not exist in the official or Centreon repository, we need to build it" + add_json_object "$name" "$package_name" "$cpan_version" "$cpan_revision" "$fpm" "$no_auto_depends" "$depends" "$provides" "$preinstall_cpan_libs" + fi +done + +# Use the temporary file to create the final JSON file +jq -s '.' "$temp_file" > $distribution_type-$distribution_version-libraries.json +# Clean up the temporary file +rm "$temp_file" \ No newline at end of file diff --git a/.github/workflows/perl-cpan-libraries-new.yml b/.github/workflows/perl-cpan-libraries-new.yml index 659a845a89..5b1f41a4ed 100644 --- a/.github/workflows/perl-cpan-libraries-new.yml +++ b/.github/workflows/perl-cpan-libraries-new.yml @@ -9,6 +9,7 @@ on: pull_request: paths: - ".github/workflows/perl-cpan-libraries-new.yml" + - ".github/scripts/get-libraries-list.sh" push: branches: - develop @@ -17,6 +18,7 @@ on: - "[2-9][0-9].[0-9][0-9].x" paths: - ".github/workflows/perl-cpan-libraries-new.yml" + - ".github/scripts/get-libraries-list.sh" jobs: get-environment: @@ -33,129 +35,49 @@ jobs: matrix: distribution: [el8, el9, bullseye, bookworm, jammy, noble] include: - - name: "ARGV::Struct" - - name: "Authen::SASL::SASLprep" - - name: "Authen::SCRAM::Client" - - name: "BSON" - rpm_provides: "perl(BSON::Bytes) perl(BSON::Code) perl(BSON::DBRef) perl(BSON::OID) perl(BSON::Raw) perl(BSON::Regex) perl(BSON::Time) perl(BSON::Timestamp) perl(BSON::Types) perl(BSON)" - - name: "BSON::XS" - - name: "Config::AWS" - - name: "Convert::Binary::C" - - name: "Convert::EBCDIC" - - name: "Crypt::Argon2" - preinstall_cpanlibs: "Dist::Build" - rpm_provides: "perl-Crypt-Argon2-debuginfo perl(Crypt::Argon2)" - deb_use_dh_make_perl: "false" - deb_no-auto-depends: "true" - deb_dependencies: "libexporter-tiny-perl libtime-hires-perl libxsloader-perl" - deb_provides: "libcrypt-argon2-perl-dbgsym" - deb_build_arm64: "true" - revision: "2" - - name: "Crypt::Blowfish_PP" - - name: "Crypt::OpenSSL::AES" - deb_use_dh_make_perl: "false" - deb_dependencies: "libexporter-tiny-perl libxs-install-perl" - deb_no-auto-depends: "true" - deb_build_arm64: "true" - - name: "DBD::Sybase" - - name: "DataStruct::Flat" - - name: "DateTime::Format::Duration::ISO8601" - rpm_provides: "perl(DateTime-Format-Duration-ISO8601)" - - name: "Device::Modbus" - - name: "Device::Modbus::RTU::Client" - - name: "Device::Modbus::TCP::Client" - - name: "Digest::SHA1" - - name: "Email::Send::SMTP::Gmail" - - name: "Exporter::Tiny" # Required by JSON::Path: the version available in the official repositories doesn't work with the last version of JSON::Path - - name: "FFI::CheckLib" - rpm_dependencies: "perl(Env)" - - name: "FFI::Platypus" - rpm_provides: "perl(FFI::Platypus::Buffer) perl(FFI::Platypus::Memory)" - rpm_dependencies: "perl(Capture::Tiny) perl(FFI::CheckLib) perl(File::Spec::Functions) perl(IPC::Cmd) perl(JSON::PP) perl(List::Util) perl(autodie) perl(constant) perl(parent)" - no-auto-depends: "true" - - name: "File::SearchPath" - - name: "HTTP::ProxyPAC" - - name: "Hash::Ordered" - - name: "JMX::Jmx4Perl" - - name: "JSON::Path" - - name: "LV" - - name: "Libssh::Session" - rpm_dependencies: "libssh" - rpm_provides: "perl-Libssh-Session-debuginfo perl(Libssh::Session) perl(Libssh::Sftp)" - deb_use_dh_make_perl: "false" - deb_no-auto-depends: "true" - deb_dependencies: "libcarp-assert-perl libdynaloader-functions-perl libexporter-tiny-perl libdevel-overloadinfo-perl libssh-4 libc6" - deb_provides: "libssh-session-perl-dbgsym libssh-session-sftp" - deb_build_arm64: "true" - revision: "2" - - name: "Mojo::IOLoop::Signal" - rpm_dependencies: "perl-Mojolicious" - rpm_provides: "perl(Mojo::IOLoop::Signal)" - no-auto-depends: "true" - - name: "MongoDB" - - name: "MooseX::ClassAttribute" - - name: "Net::Amazon::Signature::V4" - - name: "Net::Curl" - rpm_dependencies: "libcurl" - rpm_provides: "perl-Net-Curl-debuginfo perl(Net::Curl) perl(Net::Curl::Compat) perl(Net::Curl::Easy) perl(Net::Curl::Form) perl(Net::Curl::Multi) perl(Net::Curl::Share)" - deb_use_dh_make_perl: "false" - deb_no-auto-depends: "true" - deb_build_arm64: "true" - deb_dependencies: "libcarp-assert-perl libdynaloader-functions-perl libexporter-tiny-perl libdevel-overloadinfo-perl libcurl4" - deb_provides: "libnet-curl-perl-dbgsym libnet-curl-compat-perl libnet-curl-easy-perl libnet-curl-form-perl libnet-curl-share-perl libnet-curl-multi-perl" - revision: "2" - - name: "Net::DHCP" - rpm_provides: "perl(Net::DHCP::Constants) perl(Net::DHCP::Packet)" - - name: "Net::FTPSSL" - - name: "Net::HTTPTunnel" - - name: "Net::MQTT::Simple" - version: "1.29" - - name: "Net::NTP" - - name: "Net::SMTPS" - - name: "Net::SMTP_auth" - - name: "Net::Subnet" - - name: "Net::TFTP" - - name: "PBKDF2::Tiny" - - name: "Paws" - deb_use_dh_make_perl: "false" - deb_dependencies: "libmoose-perl libmoosex-classattribute-perl libjson-maybexs-perl liburl-encode-perl libargv-struct-perl libmoo-perl libtype-tiny-perl libdatastruct-flat-perl libmodule-find-perl libthrowable-perl liburi-template-perl libnet-amazon-signature-v4-perl" - deb_no-auto-depends: "true" - - name: "Statistics::Descriptive" - - name: "Statistics::Regression" - - name: "Term::Clui" - - name: "URI::Template" - - name: "URL::Encode" - - name: "URL::Encode::XS" - - name: "UUID" - version: "0.31" - - name: "UUID::URandom" - - name: "Unicode::Stringprep" - - name: "WWW::Selenium" - - name: "XML::LibXML::Simple" - - name: "XS::Loader" - - name: "ZMQ::Constants" - - name: "ZMQ::FFI" - rpm_dependencies: "zeromq" - - name: "ZMQ::LibZMQ4" - rpm_dependencies: "zeromq" - deb_build_arm64: "true" - deb_use_dh_make_perl: "false" - deb_dependencies: "libzmq5" - distribution: el8 + distribution_type: el + distribution_version: 8 image: almalinux:8 - distribution: el9 + distribution_type: el + distribution_version: 9 image: almalinux:9 - distribution: bullseye + distribution_type: debian + distribution_version: bullseye image: debian:bullseye - distribution: bookworm + distribution_type: debian + distribution_version: bookworm image: debian:bookworm - distribution: jammy + distribution_type: ubuntu + distribution_version: jammy image: ubuntu:jammy - distribution: noble + distribution_type: ubuntu + distribution_version: noble image: ubuntu:noble runs-on: ubuntu-24.04 + name: Check perl lib ${{ matrix.name }} on ${{ matrix.distrib }} + container: + image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest + credentials: + username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }} + password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }} + steps: - name: Checkout sources - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 \ No newline at end of file + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - if: startsWith(matrix.distribution, 'el') + name: Set up almalinux + run: | + dnf -y install epel-release + dnf config-manager --set-enabled powertools + + - name: Get libraries list + run: .github/scripts/get-libraries-list.sh ${{ matrix.distribution_type }} ${{ matrix.distribution_version }} \ No newline at end of file From f0b4126899005ca5511c7d815a3764ba69aa50e1 Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Sat, 5 Apr 2025 01:21:52 +0200 Subject: [PATCH 05/11] fix workflow --- .github/workflows/perl-cpan-libraries-new.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/perl-cpan-libraries-new.yml b/.github/workflows/perl-cpan-libraries-new.yml index 5b1f41a4ed..dc93a8f4ed 100644 --- a/.github/workflows/perl-cpan-libraries-new.yml +++ b/.github/workflows/perl-cpan-libraries-new.yml @@ -62,7 +62,7 @@ jobs: runs-on: ubuntu-24.04 - name: Check perl lib ${{ matrix.name }} on ${{ matrix.distrib }} + name: Check CPAN libraries ${{ matrix.distribution }} container: image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest credentials: @@ -73,7 +73,7 @@ jobs: - name: Checkout sources uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - if: startsWith(matrix.distribution, 'el') + - if: ${{ matrix.distribution_type == 'el' }} name: Set up almalinux run: | dnf -y install epel-release From 3bbd60485970d69fc93390a7a450d65ed8804c12 Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Sat, 5 Apr 2025 01:24:24 +0200 Subject: [PATCH 06/11] update --- .github/workflows/perl-cpan-libraries-new.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/perl-cpan-libraries-new.yml b/.github/workflows/perl-cpan-libraries-new.yml index dc93a8f4ed..a14de2e52c 100644 --- a/.github/workflows/perl-cpan-libraries-new.yml +++ b/.github/workflows/perl-cpan-libraries-new.yml @@ -63,11 +63,6 @@ jobs: runs-on: ubuntu-24.04 name: Check CPAN libraries ${{ matrix.distribution }} - container: - image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest - credentials: - username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }} - password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }} steps: - name: Checkout sources From 5fead6b92dabe444da7655741f0392f4ae002fc4 Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Sat, 5 Apr 2025 01:45:54 +0200 Subject: [PATCH 07/11] update --- .github/workflows/perl-cpan-libraries-new.yml | 49 ++++++++++++++----- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/.github/workflows/perl-cpan-libraries-new.yml b/.github/workflows/perl-cpan-libraries-new.yml index a14de2e52c..25f7791ddb 100644 --- a/.github/workflows/perl-cpan-libraries-new.yml +++ b/.github/workflows/perl-cpan-libraries-new.yml @@ -36,27 +36,27 @@ jobs: distribution: [el8, el9, bullseye, bookworm, jammy, noble] include: - distribution: el8 - distribution_type: el + distribution_family: el distribution_version: 8 image: almalinux:8 - distribution: el9 - distribution_type: el + distribution_family: el distribution_version: 9 image: almalinux:9 - distribution: bullseye - distribution_type: debian + distribution_family: debian distribution_version: bullseye image: debian:bullseye - distribution: bookworm - distribution_type: debian + distribution_family: debian distribution_version: bookworm image: debian:bookworm - distribution: jammy - distribution_type: ubuntu + distribution_family: ubuntu distribution_version: jammy image: ubuntu:jammy - distribution: noble - distribution_type: ubuntu + distribution_family: ubuntu distribution_version: noble image: ubuntu:noble @@ -68,11 +68,38 @@ jobs: - name: Checkout sources uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - if: ${{ matrix.distribution_type == 'el' }} - name: Set up almalinux + - name: Set up repositories run: | - dnf -y install epel-release - dnf config-manager --set-enabled powertools + if [[ "${{ matrix.distribution_family }}" == "el" ]]; then + dnf install -y epel-release 'dnf-command(config-manager)' + dnf config-manager --set-enabled powertools || true # alma 8 + dnf config-manager --set-enabled crb || true # alma 9 + # Add Centreon repository + echo -e '[centreon-plugins-stable]\n + name=centreon plugins stable x86_64\n + baseurl=https://packages.centreon.com/rpm-plugins/${{ matrix.distribution }}/stable/x86_64\n + enabled=1\n + gpgcheck=1\n + gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n + [centreon-plugins-stable-noarch]\n + name=centreon plugins stable noarch\n + baseurl=https://packages.centreon.com/rpm-plugins/${{ matrix.distribution }}/stable/noarch\n + enabled=1\n + gpgcheck=1\n + gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n' > /etc/yum.repos.d/centreon-plugins.repo + else + apt-get update + apt-get install -y wget gpg + wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1 + if [[ "${{ matrix.distribution_family }}" == "debian" ]]; then + echo "deb https://packages.centreon.com/apt-plugins-stable/ ${{ matrix.distribution_version }} main" | tee /etc/apt/sources.list.d/centreon-plugins.list + elif [[ "${{ matrix.distribution_family }}" == "ubuntu" ]]; then + echo "deb https://packages.centreon.com/ubuntu-plugins-testing/ ${{ matrix.distribution_version }} main" | tee -a /etc/apt/sources.list.d/centreon-plugins.list + fi + apt-get update + fi + shell: bash - name: Get libraries list - run: .github/scripts/get-libraries-list.sh ${{ matrix.distribution_type }} ${{ matrix.distribution_version }} \ No newline at end of file + run: .github/scripts/get-cpan-libraries-list.sh ${{ matrix.distribution_family }} ${{ matrix.distribution_version }} + shell: bash \ No newline at end of file From 7fd813a46a25c8477faefe15619c48bc10595cb1 Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Sat, 5 Apr 2025 01:50:00 +0200 Subject: [PATCH 08/11] fix --- .github/workflows/perl-cpan-libraries-new.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/perl-cpan-libraries-new.yml b/.github/workflows/perl-cpan-libraries-new.yml index 25f7791ddb..b972763fd1 100644 --- a/.github/workflows/perl-cpan-libraries-new.yml +++ b/.github/workflows/perl-cpan-libraries-new.yml @@ -61,6 +61,8 @@ jobs: image: ubuntu:noble runs-on: ubuntu-24.04 + container: + image: ${{ matrix.image }} name: Check CPAN libraries ${{ matrix.distribution }} From a54427315de312cda9b5cf5d21fb95592746d41c Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Sat, 5 Apr 2025 01:55:32 +0200 Subject: [PATCH 09/11] fix file name --- .../{get-cpan-libraires-list.sh => get-cpan-libraries-list.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/scripts/{get-cpan-libraires-list.sh => get-cpan-libraries-list.sh} (100%) diff --git a/.github/scripts/get-cpan-libraires-list.sh b/.github/scripts/get-cpan-libraries-list.sh similarity index 100% rename from .github/scripts/get-cpan-libraires-list.sh rename to .github/scripts/get-cpan-libraries-list.sh From a104761e6978fb213a9ee95c3219a756cb0fa8e7 Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Sat, 5 Apr 2025 01:57:23 +0200 Subject: [PATCH 10/11] add jq installation --- .github/workflows/perl-cpan-libraries-new.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/perl-cpan-libraries-new.yml b/.github/workflows/perl-cpan-libraries-new.yml index b972763fd1..0a3b381285 100644 --- a/.github/workflows/perl-cpan-libraries-new.yml +++ b/.github/workflows/perl-cpan-libraries-new.yml @@ -73,7 +73,7 @@ jobs: - name: Set up repositories run: | if [[ "${{ matrix.distribution_family }}" == "el" ]]; then - dnf install -y epel-release 'dnf-command(config-manager)' + dnf install -y epel-release 'dnf-command(config-manager)' jq dnf config-manager --set-enabled powertools || true # alma 8 dnf config-manager --set-enabled crb || true # alma 9 # Add Centreon repository @@ -91,7 +91,7 @@ jobs: gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n' > /etc/yum.repos.d/centreon-plugins.repo else apt-get update - apt-get install -y wget gpg + apt-get install -y wget gpg jq wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1 if [[ "${{ matrix.distribution_family }}" == "debian" ]]; then echo "deb https://packages.centreon.com/apt-plugins-stable/ ${{ matrix.distribution_version }} main" | tee /etc/apt/sources.list.d/centreon-plugins.list From a25a4bd08c5a3d4cbd599344632361ccecfd349d Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Sat, 5 Apr 2025 02:01:04 +0200 Subject: [PATCH 11/11] Add curl installation --- .github/workflows/perl-cpan-libraries-new.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/perl-cpan-libraries-new.yml b/.github/workflows/perl-cpan-libraries-new.yml index 0a3b381285..fd260b1afa 100644 --- a/.github/workflows/perl-cpan-libraries-new.yml +++ b/.github/workflows/perl-cpan-libraries-new.yml @@ -73,7 +73,7 @@ jobs: - name: Set up repositories run: | if [[ "${{ matrix.distribution_family }}" == "el" ]]; then - dnf install -y epel-release 'dnf-command(config-manager)' jq + dnf install -y epel-release 'dnf-command(config-manager)' jq curl dnf config-manager --set-enabled powertools || true # alma 8 dnf config-manager --set-enabled crb || true # alma 9 # Add Centreon repository @@ -91,7 +91,7 @@ jobs: gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n' > /etc/yum.repos.d/centreon-plugins.repo else apt-get update - apt-get install -y wget gpg jq + apt-get install -y wget gpg jq curl wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1 if [[ "${{ matrix.distribution_family }}" == "debian" ]]; then echo "deb https://packages.centreon.com/apt-plugins-stable/ ${{ matrix.distribution_version }} main" | tee /etc/apt/sources.list.d/centreon-plugins.list