diff --git a/.github/actions/deb-delivery-legacy/action.yml b/.github/actions/deb-delivery-legacy/action.yml index 00cba4df8..624b048cd 100644 --- a/.github/actions/deb-delivery-legacy/action.yml +++ b/.github/actions/deb-delivery-legacy/action.yml @@ -24,10 +24,11 @@ runs: using: "composite" steps: - name: Use cache DEB files - uses: actions/cache@v3 + uses: actions/cache/restore@v3 with: path: ./*.deb key: ${{ inputs.cache_key }} + fail-on-cache-miss: true - name: Publish DEBs to Nexus run: | diff --git a/.github/actions/deb-delivery/action.yml b/.github/actions/deb-delivery/action.yml index 6d57f6f98..9faad28cd 100644 --- a/.github/actions/deb-delivery/action.yml +++ b/.github/actions/deb-delivery/action.yml @@ -24,10 +24,11 @@ runs: using: "composite" steps: - name: Use cache DEB files - uses: actions/cache@v3 + uses: actions/cache/restore@v3 with: path: ./*.deb key: ${{ inputs.cache_key }} + fail-on-cache-miss: true - uses: jfrog/setup-jfrog-cli@v3 env: diff --git a/.github/actions/package/action.yml b/.github/actions/package/action.yml index 5883ca2d5..b0797d1ec 100644 --- a/.github/actions/package/action.yml +++ b/.github/actions/package/action.yml @@ -1,84 +1,85 @@ name: package -description: Package module +description: Package module using nfpm inputs: + nfpm_file_pattern: + description: The pattern of the nfpm configuration file(s) + required: true package_extension: description: The package extension (deb or rpm) required: true distrib: - description: The package distrib (el8, bullseye...) - required: true - image_name: - description: The docker image name - required: true - script_name: - description: The packaging script name - plugins: - description: List of plugins to package + description: The package distrib required: true version: - description: The plugins version - required: true + description: The package version + required: false release: - description: The release number + description: The package release number + required: false + commit_hash: + description: The commit hash required: true cache_key: description: The package files cache key required: true - sign: - description: Wether to sign the package or not - default: "" - registry_url: - description: Docker registry url + rpm_gpg_key: + description: The rpm gpg key required: true - registry_username: - description: Docker registry username + rpm_gpg_signing_key_id: + description: The rpm gpg signing key identifier required: true - registry_password: - description: Docker registry password + rpm_gpg_signing_passphrase: + description: The rpm gpg signing passphrase required: true runs: using: composite steps: - - name: Login to Registry - uses: docker/login-action@v2 - with: - registry: ${{ inputs.registry_url }} - username: ${{ inputs.registry_username }} - password: ${{ inputs.registry_password }} + - name: Import gpg key + env: + RPM_GPG_SIGNING_KEY: ${{ inputs.rpm_gpg_key }} + run: echo -n "$RPM_GPG_SIGNING_KEY" > key.gpg + shell: bash - - name: Package - uses: ./.github/actions/runner-docker - with: - script_name: ${{ inputs.script_name }} - image_name: ${{ inputs.image_name }} - image_version: latest - registry_url: ${{ inputs.registry_url }} - registry_username: ${{ inputs.registry_username }} - registry_password: ${{ inputs.registry_password }} - params: ${{ inputs.version }} ${{ inputs.release }} "${{ inputs.plugins }}" + - name: Build ${{ inputs.package_extension }} files + env: + RPM_GPG_SIGNING_KEY_ID: ${{ inputs.rpm_gpg_signing_key_id }} + RPM_GPG_SIGNING_PASSPHRASE: ${{ inputs.rpm_gpg_signing_passphrase }} + run: | + export VERSION="${{ inputs.version }}" + export RELEASE="${{ inputs.release }}" - - name: Sign - if: ${{ inputs.sign != '' && inputs.package_extension == 'rpm' }} - uses: ./.github/actions/runner-docker - with: - script_name: rpm-signing - image_name: rpm-signing - image_version: ubuntu - registry_url: ${{ inputs.registry_url }} - registry_username: ${{ inputs.registry_username }} - registry_password: ${{ inputs.registry_password }} + if [ "${{ inputs.package_extension }}" = "rpm" ]; then + export DIST=".${{ inputs.distrib }}" + else + export DIST="" + fi - - name: Cache packaged files - uses: actions/cache@v3 - with: - path: ./*.${{ inputs.package_extension }} - key: ${{ inputs.cache_key }} + export RPM_SIGNING_KEY_FILE="$(pwd)/key.gpg" + export RPM_SIGNING_KEY_ID="$RPM_GPG_SIGNING_KEY_ID" + export NFPM_RPM_PASSPHRASE="$RPM_GPG_SIGNING_PASSPHRASE" - - if: ${{ inputs.distrib == 'el8' }} + for FILE in ${{ inputs.nfpm_file_pattern }}; do + DIRNAME=$(dirname $FILE) + BASENAME=$(basename $FILE) + cd $DIRNAME + sed -i "s/@COMMIT_HASH@/${{ inputs.commit_hash }}/g" $BASENAME + nfpm package --config $BASENAME --packager ${{ inputs.package_extension }} + cd - + mv $DIRNAME/*.${{ inputs.package_extension }} ./ + done + shell: bash + + - name: Upload package artifacts uses: actions/upload-artifact@v3 with: name: packages-${{ inputs.distrib }} path: ./*.${{ inputs.package_extension }} retention-days: 1 + + - name: Cache packages + uses: actions/cache/save@v3 + with: + path: ./*.${{ inputs.package_extension }} + key: ${{ inputs.cache_key }} diff --git a/.github/actions/rpm-delivery-legacy/action.yml b/.github/actions/rpm-delivery-legacy/action.yml index dba196186..bf7b7ff41 100644 --- a/.github/actions/rpm-delivery-legacy/action.yml +++ b/.github/actions/rpm-delivery-legacy/action.yml @@ -36,10 +36,11 @@ runs: using: "composite" steps: - name: Use cache RPM files - uses: actions/cache@v3 + uses: actions/cache/restore@v3 with: path: ./*.rpm key: ${{ inputs.cache_key }} + fail-on-cache-miss: true - name: Setup awscli run: | diff --git a/.github/actions/rpm-delivery/action.yml b/.github/actions/rpm-delivery/action.yml index 99b16e438..94622ce2d 100644 --- a/.github/actions/rpm-delivery/action.yml +++ b/.github/actions/rpm-delivery/action.yml @@ -21,10 +21,11 @@ runs: using: "composite" steps: - name: Use cache RPM files - uses: actions/cache@v3 + uses: actions/cache/restore@v3 with: path: ./*.rpm key: ${{ inputs.cache_key }} + fail-on-cache-miss: true - uses: jfrog/setup-jfrog-cli@v3 env: diff --git a/.github/docker/Dockerfile.packaging-plugins-alma8 b/.github/docker/Dockerfile.packaging-plugins-alma8 index 5337a9edb..e1f986e62 100644 --- a/.github/docker/Dockerfile.packaging-plugins-alma8 +++ b/.github/docker/Dockerfile.packaging-plugins-alma8 @@ -10,7 +10,7 @@ baseurl=https://repo.goreleaser.com/yum/ enabled=1 gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo -dnf -y install git gettext rpm-build dos2unix python3 epel-release nfpm zstd +dnf -y install git gettext rpm-build dos2unix python3 epel-release nfpm jq zstd dnf -y install perl-App-cpanminus perl-JSON cpanm App::FatPacker cpanm File::Copy::Recursive diff --git a/.github/docker/Dockerfile.packaging-plugins-alma9 b/.github/docker/Dockerfile.packaging-plugins-alma9 index 458541df3..c7d393227 100644 --- a/.github/docker/Dockerfile.packaging-plugins-alma9 +++ b/.github/docker/Dockerfile.packaging-plugins-alma9 @@ -10,7 +10,7 @@ baseurl=https://repo.goreleaser.com/yum/ enabled=1 gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo -dnf -y install git gettext rpm-build dos2unix python3 epel-release nfpm zstd +dnf -y install git gettext rpm-build dos2unix python3 epel-release nfpm jq zstd dnf -y install perl-App-cpanminus perl-JSON cpanm App::FatPacker cpanm File::Copy::Recursive diff --git a/.github/docker/Dockerfile.packaging-plugins-centos7 b/.github/docker/Dockerfile.packaging-plugins-centos7 index b43fc6571..78561500f 100644 --- a/.github/docker/Dockerfile.packaging-plugins-centos7 +++ b/.github/docker/Dockerfile.packaging-plugins-centos7 @@ -10,8 +10,8 @@ baseurl=https://repo.goreleaser.com/yum/ enabled=1 gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo -yum -y install git gettext rpm-build dos2unix python3 epel-release nfpm zstd -yum -y install perl-App-FatPacker perl-File-Copy-Recursive perl-JSON +yum -y install git gettext rpm-build dos2unix python3 epel-release nfpm +yum -y install perl-App-FatPacker perl-File-Copy-Recursive perl-JSON jq zstd yum clean all EOF diff --git a/.github/packaging/centreon-plugin.yaml.template b/.github/packaging/centreon-plugin.yaml.template new file mode 100644 index 000000000..798020b46 --- /dev/null +++ b/.github/packaging/centreon-plugin.yaml.template @@ -0,0 +1,88 @@ +name: "@PACKAGE_NAME@" +arch: "all" +platform: "linux" +version_schema: "none" +version: "${VERSION}" +release: "${RELEASE}${DIST}" +section: "default" +priority: "optional" +maintainer: "Centreon " +description: | + @SUMMARY@ + Commit: @COMMIT_HASH@ +vendor: "Centreon" +homepage: "https://centreon.com" +license: "Apache-2.0" + +contents: + - src: "../../build/@PLUGIN_NAME@/*" + dst: "/usr/lib/centreon/plugins/" + file_info: + mode: 0775 + +conflicts: + [@CONFLICTS@] +replaces: + [@REPLACES@] +provides: + [@PROVIDES@] + +overrides: + rpm: + depends: [ + perl(Digest::MD5), + perl(Pod::Find), + perl-Net-Curl, + perl(URI::Encode), + perl(LWP::UserAgent), + perl(LWP::Protocol::https), + perl(IO::Socket::SSL), + perl(URI), + perl(HTTP::ProxyPAC), + perl-CryptX, + perl(MIME::Base64), + perl(JSON::XS), + perl-JSON-Path, + perl-KeePass-Reader, + perl(Storable), + perl(POSIX), + perl(Encode), + @RPM_DEPENDENCIES@ + ] + conflicts: + [@RPM_CONFLICTS@] + replaces: + [@RPM_REPLACES@] + provides: + [@RPM_PROVIDES@] + deb: + depends: [ + libpod-parser-perl, + libnet-curl-perl, + liburi-encode-perl, + libwww-perl, + liblwp-protocol-https-perl, + libhttp-cookies-perl, + libio-socket-ssl-perl, + liburi-perl, + libhttp-proxypac-perl, + libcryptx-perl, + libjson-xs-perl, + libjson-path-perl, + libcrypt-argon2-perl, + libkeepass-reader-perl, + libdatetime-perl, + @RPM_DEPENDENCIES@ + ] + conflicts: + [@DEB_CONFLICTS@] + replaces: + [@DEB_REPLACES@] + provides: + [@DEB_PROVIDES@] + +rpm: + compression: zstd + signature: + key_file: ${RPM_SIGNING_KEY_FILE} + key_id: ${RPM_SIGNING_KEY_ID} diff --git a/.github/packaging/debian/control.body.template b/.github/packaging/debian/control.body.template deleted file mode 100644 index 340a0939e..000000000 --- a/.github/packaging/debian/control.body.template +++ /dev/null @@ -1,24 +0,0 @@ - -Package: @NAME@ -Architecture: all -Description: @SUMMARY@@CUSTOM_PKG_DATA@ -Depends: - ${shlibs:Depends}, - ${misc:Depends}, - libpod-parser-perl, - libnet-curl-perl, - liburi-encode-perl, - libwww-perl, - liblwp-protocol-https-perl, - libhttp-cookies-perl, - libio-socket-ssl-perl, - liburi-perl, - libhttp-proxypac-perl, - libcryptx-perl, - libjson-xs-perl, - libjson-path-perl, - libcrypt-argon2-perl, - libkeepass-reader-perl, - libdatetime-perl, - @REQUIRES@ - diff --git a/.github/packaging/debian/control.head.template b/.github/packaging/debian/control.head.template deleted file mode 100644 index 419718341..000000000 --- a/.github/packaging/debian/control.head.template +++ /dev/null @@ -1,12 +0,0 @@ -Source: centreon-plugins -Section: net -Priority: optional -Maintainer: Centreon -Build-Depends: - debhelper-compat (= 12), - libapp-fatpacker-perl, - libfile-copy-recursive-perl, - libjson-perl -Standards-Version: 4.5.0 -Homepage: https://www.centreon.com - diff --git a/.github/packaging/debian/copyright b/.github/packaging/debian/copyright deleted file mode 100644 index 25b92b586..000000000 --- a/.github/packaging/debian/copyright +++ /dev/null @@ -1,29 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: centreon-collect -Upstream-Contact: Centreon -Source: https://www.centreon.com - -Files: * -Copyright: 2023 Centreon -License: Apache-2.0 - -Files: debian/* -Copyright: 2023 Centreon -License: Apache-2.0 - -License: Apache-2.0 - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - . - https://www.apache.org/licenses/LICENSE-2.0 - . - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - . - On Debian systems, the complete text of the Apache version 2.0 license - can be found in "/usr/share/common-licenses/Apache-2.0". - diff --git a/.github/packaging/debian/plugin.install.template b/.github/packaging/debian/plugin.install.template deleted file mode 100644 index 937497ef7..000000000 --- a/.github/packaging/debian/plugin.install.template +++ /dev/null @@ -1 +0,0 @@ -plugins/@DIR@/@NAME@ usr/lib/centreon/plugins diff --git a/.github/packaging/debian/rules b/.github/packaging/debian/rules deleted file mode 100644 index d1cd2b1a6..000000000 --- a/.github/packaging/debian/rules +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/make -f - -%: - dh $@ - -override_dh_clean: -override_dh_auto_build: diff --git a/.github/packaging/debian/source/format b/.github/packaging/debian/source/format deleted file mode 100644 index 163aaf8d8..000000000 --- a/.github/packaging/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/.github/packaging/rpm/plugin.spectemplate b/.github/packaging/rpm/plugin.spectemplate deleted file mode 100644 index 3e7bae4ab..000000000 --- a/.github/packaging/rpm/plugin.spectemplate +++ /dev/null @@ -1,48 +0,0 @@ -Name: @NAME@ -Version: @VERSION@ -Release: @RELEASE@%{?dist} -Source0: %{name}-%{version}.tar.gz -Summary: @SUMMARY@ -Group: Development/Libraries -License: Apache-2.0 -URL: https://www.centreon.com/ -BuildArch: noarch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -AutoReqProv: no - -AutoReqProv: no -Requires: perl(Digest::MD5) -Requires: perl(Pod::Find) -Requires: perl-Net-Curl -Requires: perl(URI::Encode) -Requires: perl(LWP::UserAgent) -Requires: perl(LWP::Protocol::https) -Requires: perl(IO::Socket::SSL) -Requires: perl(URI) -Requires: perl(HTTP::ProxyPAC) -Requires: perl-CryptX -Requires: perl(MIME::Base64) -Requires: perl(JSON::XS) -Requires: perl-JSON-Path -Requires: perl-KeePass-Reader -Requires: perl(Storable) -Requires: perl(POSIX) -Requires: perl(Encode) -@REQUIRES@ - -@CUSTOM_PKG_DATA@ - -%description -Centreon plugin - -%prep -%setup -q - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}/usr/lib/centreon/plugins/ -%{__install} -m 775 *.pl %{buildroot}%{_prefix}/lib/centreon/plugins/ - -%files -%defattr(-,root,root,-) -%{_prefix}/lib/centreon/plugins/@PLUGIN_NAME@ diff --git a/.github/scripts/plugin-packaging-deb.sh b/.github/scripts/plugin-packaging-deb.sh deleted file mode 100755 index fdfa97f8c..000000000 --- a/.github/scripts/plugin-packaging-deb.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash - -set -e - -VERSION="$1" -RELEASE="$2" -PLUGINS="$3" - -cd /src - -mkdir -p centreon-plugins/plugins -cp -R .github/packaging/debian centreon-plugins/debian -mv centreon-plugins/debian/control.head.template centreon-plugins/debian/control - -for PLUGIN in $PLUGINS; do - - PACKAGE_PATH=$PLUGIN - - if [[ "$PLUGIN" =~ (.+)"=>"(.+) ]]; then - PACKAGE_PATH=$(echo ${BASH_REMATCH[1]}) - PLUGIN=$(echo ${BASH_REMATCH[2]}) - fi - - PLUGIN_NAME_LOWER=$(echo "$PLUGIN" | tr '[:upper:]' '[:lower:]') - - echo "::group::Preparing $PLUGIN_NAME_LOWER" - - mkdir centreon-plugins/plugins/$PLUGIN - cp -R build/$PLUGIN/*.pl centreon-plugins/plugins/$PLUGIN - - # Process package files - pkg_values=($(cat "packaging/$PACKAGE_PATH/pkg.json" | jq -r '.pkg_name,.plugin_name')) - pkg_summary=$(echo "${pkg_values[0]}") - plugin_name=$(echo "${pkg_values[1]}") - deb_dependencies=$(cat "packaging/$PACKAGE_PATH/deb.json" | jq -r '.dependencies | join(",\\n ")') - deb_custom_pkg_data=$(cat "packaging/$PACKAGE_PATH/deb.json" | jq -r '.custom_pkg_data // "" | if . != "" then ("\\n" + .) else "" end') - - sed -e "s/@NAME@/$PLUGIN_NAME_LOWER/g" \ - -e "s/@SUMMARY@/$pkg_summary/g" \ - -e "s/@REQUIRES@/$deb_dependencies/g" \ - -e "s/@CUSTOM_PKG_DATA@/$deb_custom_pkg_data/g" \ - < centreon-plugins/debian/control.body.template \ - >> centreon-plugins/debian/control - - # .install file - sed -e "s/@DIR@/$PLUGIN/g" -e "s/@NAME@/$plugin_name/g" < centreon-plugins/debian/plugin.install.template >> centreon-plugins/debian/$PLUGIN_NAME_LOWER.install - - echo "::endgroup::" -done - -rm -f centreon-plugins/debian/*.template -tar czf centreon-plugins-${VERSION}-${RELEASE}.tar.gz centreon-plugins -cd centreon-plugins -debmake -f "Centreon" -e "contact@centreon.com" -u "${VERSION}-${RELEASE}" -y -r "bullseye" -debuild-pbuilder --no-lintian diff --git a/.github/scripts/plugin-packaging-rpm.sh b/.github/scripts/plugin-packaging-rpm.sh deleted file mode 100755 index e209d312f..000000000 --- a/.github/scripts/plugin-packaging-rpm.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -set -e - -VERSION="$1" -RELEASE="$2" -PLUGINS="$3" - -for PLUGIN_NAME in $PLUGINS; do - echo "::group::Packaging $PLUGIN_NAME" - - PACKAGE_PATH=$PLUGIN_NAME - - if [[ "$PLUGIN_NAME" =~ (.+)"=>"(.+) ]]; then - PACKAGE_PATH=$(echo ${BASH_REMATCH[1]}) - PLUGIN_NAME=$(echo ${BASH_REMATCH[2]}) - fi - - # Process specfile - rm -f plugin.specfile - python3 .github/scripts/create-spec-file.py "$PACKAGE_PATH" "$PLUGIN_NAME" "$VERSION" "$RELEASE" - - rm -rf $HOME/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} - mkdir -p $HOME/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} - - mv build/$PLUGIN_NAME $PLUGIN_NAME-$VERSION - tar czf $PLUGIN_NAME-$VERSION.tar.gz $PLUGIN_NAME-$VERSION - mv $PLUGIN_NAME-$VERSION.tar.gz $HOME/rpmbuild/SOURCES/ - - cd $PLUGIN_NAME-$VERSION - rpmbuild -ba ../plugin.specfile - find $HOME/rpmbuild/RPMS -name *.rpm -exec mv {} /src/ \; - - cd - - - echo "::endgroup::" -done diff --git a/.github/scripts/rpm-signing.sh b/.github/scripts/rpm-signing.sh deleted file mode 100755 index 07bc88276..000000000 --- a/.github/scripts/rpm-signing.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -set -ex -export GPG_TTY=$(tty) -rpmsign --addsign /src/*.rpm diff --git a/.github/workflows/connector-vmware.yml b/.github/workflows/connector-vmware.yml index 6afd589d3..52be7e5dd 100644 --- a/.github/workflows/connector-vmware.yml +++ b/.github/workflows/connector-vmware.yml @@ -29,6 +29,7 @@ jobs: package: needs: - get-environment + runs-on: ubuntu-22.04 strategy: matrix: include: @@ -41,18 +42,32 @@ jobs: - package_extension: deb image: packaging-plugins-bullseye distrib: bullseye + + container: + image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }} + credentials: + username: ${{ secrets.DOCKER_REGISTRY_ID }} + password: ${{ secrets.DOCKER_REGISTRY_PASSWD }} + name: package ${{ matrix.distrib }} - uses: ./.github/workflows/package.yml - with: - nfpm_file_pattern: "connectors/vmware/packaging/centreon-plugin-virtualization-vmware-daemon.yaml" - distrib: ${{ matrix.distrib }} - package_extension: ${{ matrix.package_extension }} - image_name: ${{ matrix.image }} - version: ${{ needs.get-environment.outputs.version }} - release: ${{ needs.get-environment.outputs.release }} - cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }} - secrets: inherit + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Package + uses: ./.github/actions/package + with: + nfpm_file_pattern: "connectors/vmware/packaging/centreon-plugin-virtualization-vmware-daemon.yaml" + distrib: ${{ matrix.distrib }} + package_extension: ${{ matrix.package_extension }} + version: ${{ needs.get-environment.outputs.version }} + release: ${{ needs.get-environment.outputs.release }} + commit_hash: ${{ github.sha }} + cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }} + rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }} + rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }} + rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }} deliver-rpm: needs: diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml deleted file mode 100644 index aef00f0ce..000000000 --- a/.github/workflows/package.yml +++ /dev/null @@ -1,117 +0,0 @@ -on: - workflow_call: - inputs: - nfpm_file_pattern: - type: string - description: The pattern of the nfpm configuration file(s) - required: true - distrib: - type: string - description: The distrib - required: true - package_extension: - type: string - description: The package extension (deb or rpm) - required: true - image_name: - type: string - description: The image name - required: true - version: - type: string - description: The package version - required: false - release: - type: string - description: The release number - required: false - source_cache_key: - type: string - description: The source files cache key - required: false - source_cache_path: - type: string - description: The source files path - required: false - cache_key: - type: string - description: The package files cache key - required: true - -jobs: - package: - runs-on: ubuntu-22.04 - container: - image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ inputs.image_name }} - credentials: - username: ${{ secrets.DOCKER_REGISTRY_ID }} - password: ${{ secrets.DOCKER_REGISTRY_PASSWD }} - - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Import gpg key - env: - RPM_GPG_SIGNING_KEY: ${{ secrets.RPM_GPG_SIGNING_KEY }} - run: echo -n "$RPM_GPG_SIGNING_KEY" > key.gpg - shell: bash - - - if: ${{ inputs.source_cache_key != '' && inputs.source_cache_path != '' }} - name: Import source files - uses: actions/cache/restore@v3 - with: - path: ${{ inputs.source_cache_path }} - key: ${{ inputs.source_cache_key }} - fail-on-cache-miss: true - - - name: Build ${{ inputs.package_extension }} files - env: - RPM_GPG_SIGNING_KEY_ID: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }} - RPM_GPG_SIGNING_PASSPHRASE: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }} - run: | - export VERSION="${{ inputs.version }}" - export RELEASE="${{ inputs.release }}" - - if [ "${{ inputs.package_extension }}" = "rpm" ]; then - export DIST=".${{ inputs.distrib }}" - export APACHE_USER="apache" - export APACHE_GROUP="apache" - else - export DIST="" - export APACHE_USER="www-data" - export APACHE_GROUP="www-data" - fi - - export PERL_SITELIB="$(eval "$(perl -V:installsitelib)"; echo $installsitelib)" - export PERL_VENDORLIB="$(eval "$(perl -V:installvendorlib)"; echo $installvendorlib)" - - export RPM_SIGNING_KEY_FILE="$(pwd)/key.gpg" - export RPM_SIGNING_KEY_ID="$RPM_GPG_SIGNING_KEY_ID" - export NFPM_RPM_PASSPHRASE="$RPM_GPG_SIGNING_PASSPHRASE" - - for FILE in ${{ inputs.nfpm_file_pattern }}; do - DIRNAME=$(dirname $FILE) - BASENAME=$(basename $FILE) - cd $DIRNAME - sed -i \ - "s/@COMMIT_HASH@/${{ github.sha }}/g; s#@PERL_SITELIB@#${PERL_SITELIB}#g; s#@PERL_VENDORLIB@#${PERL_VENDORLIB}#g" \ - $BASENAME - nfpm package --config $BASENAME --packager ${{ inputs.package_extension }} - cd - - mv $DIRNAME/*.${{ inputs.package_extension }} ./ - done - shell: bash - - - name: Upload package artifacts - uses: actions/upload-artifact@v3 - with: - name: packages-${{ inputs.distrib }} - path: ./*.${{ inputs.package_extension }} - retention-days: 1 - - - name: Cache packages - uses: actions/cache@v3 - with: - path: ./*.${{ inputs.package_extension }} - key: ${{ inputs.cache_key }} diff --git a/.github/workflows/perl-vmware-vsphere.yml b/.github/workflows/perl-vmware-vsphere.yml index be2485f30..4656e0449 100644 --- a/.github/workflows/perl-vmware-vsphere.yml +++ b/.github/workflows/perl-vmware-vsphere.yml @@ -49,6 +49,7 @@ jobs: package: needs: - get-sources + runs-on: ubuntu-22.04 strategy: matrix: include: @@ -61,18 +62,37 @@ jobs: - package_extension: deb image: packaging-plugins-bullseye distrib: bullseye + + container: + image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }} + credentials: + username: ${{ secrets.DOCKER_REGISTRY_ID }} + password: ${{ secrets.DOCKER_REGISTRY_PASSWD }} + name: package ${{ matrix.distrib }} - uses: ./.github/workflows/package.yml - with: - nfpm_file_pattern: "dependencies/perl-vmware-vsphere/packaging/perl-vmware-vsphere.yaml" - distrib: ${{ matrix.distrib }} - package_extension: ${{ matrix.package_extension }} - image_name: ${{ matrix.image }} - source_cache_key: ${{ github.sha }}-${{ github.run_id }}-sources-perl-vmware-vsphere - source_cache_path: vmware-vsphere-cli-distrib - cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }} - secrets: inherit + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Import source files + uses: actions/cache/restore@v3 + with: + path: vmware-vsphere-cli-distrib + key: ${{ github.sha }}-${{ github.run_id }}-sources-perl-vmware-vsphere + fail-on-cache-miss: true + + - name: Package + uses: ./.github/actions/package + with: + nfpm_file_pattern: "dependencies/perl-vmware-vsphere/packaging/perl-vmware-vsphere.yaml" + distrib: ${{ matrix.distrib }} + package_extension: ${{ matrix.package_extension }} + commit_hash: ${{ github.sha }} + cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }} + rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }} + rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }} + rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }} deliver-rpm: needs: diff --git a/.github/workflows/plugin-delivery.yml b/.github/workflows/plugin-delivery.yml index 56958e9bb..81cdb2f6b 100644 --- a/.github/workflows/plugin-delivery.yml +++ b/.github/workflows/plugin-delivery.yml @@ -46,10 +46,11 @@ jobs: - name: Checkout sources uses: actions/checkout@v3 - - uses: actions/cache@v3 + - uses: actions/cache/restore@v3 with: path: ./build/ key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }} + fail-on-cache-miss: true - name: Deliver sources uses: ./.github/actions/release-sources diff --git a/.github/workflows/plugin-package.yml b/.github/workflows/plugin-package.yml deleted file mode 100644 index 9a75f5fe4..000000000 --- a/.github/workflows/plugin-package.yml +++ /dev/null @@ -1,88 +0,0 @@ -on: - workflow_call: - inputs: - plugins: - required: true - type: string - version: - required: true - type: string - release: - required: true - type: string - secrets: - registry_username: - required: true - registry_password: - required: true - -jobs: - fatpacker: - runs-on: ubuntu-22.04 - steps: - - name: Checkout sources - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - - name: Prepare FatPacker - uses: shogo82148/actions-setup-perl@v1 - with: - perl-version: '5.34' - install-modules-with: cpm - install-modules: App::FatPacker File::Copy::Recursive JSON - - - name: Run FatPacker - run: | - COMMIT=$(git log -1 HEAD --pretty=format:%h) - perl .github/scripts/plugins-source.container.pl "${{ inputs.plugins }}" "${{ inputs.version }} ($COMMIT)" - - - uses: actions/cache@v3 - with: - path: ./build/ - key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }} - - package: - runs-on: ubuntu-22.04 - needs: [fatpacker] - - strategy: - matrix: - include: - - package_extension: rpm - image: packaging-plugins-centos7 - distrib: el7 - - package_extension: rpm - image: packaging-plugins-alma8 - distrib: el8 - - package_extension: rpm - image: packaging-plugins-alma9 - distrib: el9 - - package_extension: deb - image: packaging-plugins-bullseye - distrib: bullseye - name: "package ${{ matrix.distrib }}" - - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - uses: actions/cache@v3 - with: - path: ./build/ - key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }} - - - uses: ./.github/actions/package - with: - package_extension: ${{ matrix.package_extension }} - distrib: ${{ matrix.distrib }} - image_name: ${{ matrix.image }} - script_name: plugin-packaging-${{ matrix.package_extension }} - plugins: ${{ inputs.plugins }} - version: ${{ inputs.version }} - release: ${{ inputs.release }} - cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }} - sign: true - registry_url: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }} - registry_username: ${{ secrets.registry_username }} - registry_password: ${{ secrets.registry_password }} diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 6af13d3d1..6745b3758 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -84,17 +84,144 @@ jobs: fi shell: bash - package: + fatpacker: if: ${{ needs.get-plugins.outputs.plugins != '' }} needs: [get-environment, get-plugins] - uses: ./.github/workflows/plugin-package.yml - with: - plugins: ${{ needs.get-plugins.outputs.plugins }} - version: ${{ needs.get-environment.outputs.version }} - release: ${{ needs.get-environment.outputs.release }} - secrets: - registry_username: ${{ secrets.DOCKER_REGISTRY_ID }} - registry_password: ${{ secrets.DOCKER_REGISTRY_PASSWD }} + runs-on: ubuntu-22.04 + steps: + - name: Checkout sources + uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Prepare FatPacker + uses: shogo82148/actions-setup-perl@v1 + with: + perl-version: '5.34' + install-modules-with: cpm + install-modules: App::FatPacker File::Copy::Recursive JSON + + - name: Run FatPacker + run: | + COMMIT=$(git log -1 HEAD --pretty=format:%h) + perl .github/scripts/plugins-source.container.pl "${{ needs.get-plugins.outputs.plugins }}" "${{ needs.get-environment.outputs.version }} ($COMMIT)" + + - uses: actions/cache/save@v3 + with: + path: ./build/ + key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }} + + package: + runs-on: ubuntu-22.04 + needs: [get-environment, get-plugins, fatpacker] + + strategy: + fail-fast: false + matrix: + include: + - package_extension: rpm + image: packaging-plugins-centos7 + distrib: el7 + - package_extension: rpm + image: packaging-plugins-alma8 + distrib: el8 + - package_extension: rpm + image: packaging-plugins-alma9 + distrib: el9 + - package_extension: deb + image: packaging-plugins-bullseye + distrib: bullseye + + container: + image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }} + credentials: + username: ${{ secrets.DOCKER_REGISTRY_ID }} + password: ${{ secrets.DOCKER_REGISTRY_PASSWD }} + + name: "package ${{ matrix.distrib }}" + + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - uses: actions/cache/restore@v3 + with: + path: ./build/ + key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }} + fail-on-cache-miss: true + + - run: | + PLUGINS="${{ needs.get-plugins.outputs.plugins }}" + for PLUGIN in $PLUGINS; do + PACKAGE_PATH=$PLUGIN + + if [[ "$PLUGIN" =~ (.+)"=>"(.+) ]]; then + PACKAGE_PATH=$(echo ${BASH_REMATCH[1]}) + PLUGIN=$(echo ${BASH_REMATCH[2]}) + fi + + PLUGIN_NAME_LOWER=$(echo "$PLUGIN" | tr '[:upper:]' '[:lower:]') + + echo "::group::Preparing $PLUGIN_NAME_LOWER" + + # Process package files + pkg_values=($(cat "packaging/$PACKAGE_PATH/pkg.json" | jq -r '.pkg_name,.plugin_name')) + pkg_summary=$(echo "${pkg_values[0]}") + plugin_name=$(echo "${pkg_values[1]}") + conflicts=$(cat "packaging/$PACKAGE_PATH/pkg.json" | jq -r '.conflicts // [] | join(",")') + replaces=$(cat "packaging/$PACKAGE_PATH/pkg.json" | jq -r '.replaces // [] | join(",")') + provides=$(cat "packaging/$PACKAGE_PATH/pkg.json" | jq -r '.provides // [] | join(",")') + deb_dependencies=$(cat "packaging/$PACKAGE_PATH/deb.json" | jq -r '.dependencies // [] | join(",")') + deb_conflicts=$(cat "packaging/$PACKAGE_PATH/deb.json" | jq -r '.conflicts // [] | join(",")') + deb_replaces=$(cat "packaging/$PACKAGE_PATH/deb.json" | jq -r '.replaces // [] | join(",")') + deb_provides=$(cat "packaging/$PACKAGE_PATH/deb.json" | jq -r '.provides // [] | join(",")') + rpm_dependencies=$(cat "packaging/$PACKAGE_PATH/rpm.json" | jq -r '.dependencies // [] | join(",")') + rpm_conflicts=$(cat "packaging/$PACKAGE_PATH/rpm.json" | jq -r '.conflicts // [] | join(",")') + rpm_replaces=$(cat "packaging/$PACKAGE_PATH/rpm.json" | jq -r '.replaces // [] | join(",")') + rpm_provides=$(cat "packaging/$PACKAGE_PATH/rpm.json" | jq -r '.provides // [] | join(",")') + + sed -e "s/@PLUGIN_NAME@/$PLUGIN/g;" \ + -e "s/@SUMMARY@/$pkg_summary/g" \ + -e "s/@CONFLICTS@/$conflicts/g" \ + -e "s/@REPLACES@/$replaces/g" \ + -e "s/@PROVIDES@/$provides/g" \ + -e "s/@DEB_DEPENDENCIES@/$deb_dependencies/g" \ + -e "s/@DEB_CONFLICTS@/$deb_conflicts/g" \ + -e "s/@DEB_REPLACES@/$deb_replaces/g" \ + -e "s/@DEB_PROVIDES@/$deb_provides/g" \ + -e "s/@RPM_DEPENDENCIES@/$rpm_dependencies/g" \ + -e "s/@RPM_CONFLICTS@/$rpm_conflicts/g" \ + -e "s/@RPM_REPLACES@/$rpm_replaces/g" \ + -e "s/@RPM_PROVIDES@/$rpm_provides/g" \ + < .github/packaging/centreon-plugin.yaml.template \ + >> .github/packaging/$PLUGIN.yaml + + if [ "${{ matrix.package_extension }}" = "rpm" ]; then + sed -i "s/@PACKAGE_NAME@/$PLUGIN/g" \ + .github/packaging/$PLUGIN.yaml + else + sed -i "s/@PACKAGE_NAME@/$PLUGIN_NAME_LOWER/g" \ + .github/packaging/$PLUGIN.yaml + fi + + cat .github/packaging/$PLUGIN.yaml + + echo "::endgroup::" + done + shell: bash + + - uses: ./.github/actions/package + with: + nfpm_file_pattern: ".github/packaging/*.yaml" + distrib: ${{ matrix.distrib }} + package_extension: ${{ matrix.package_extension }} + version: ${{ needs.get-environment.outputs.version }} + release: ${{ needs.get-environment.outputs.release }} + commit_hash: ${{ github.sha }} + cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }} + rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }} + rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }} + rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }} deliver: needs: [get-environment, package] diff --git a/.github/workflows/tests-functional.yml b/.github/workflows/tests-functional.yml index 406def0b0..f90e0fa60 100644 --- a/.github/workflows/tests-functional.yml +++ b/.github/workflows/tests-functional.yml @@ -1,4 +1,9 @@ name: Functional tests + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + on: workflow_dispatch: pull_request: @@ -8,16 +13,19 @@ on: jobs: AWS_tests: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - name: Use Node.js uses: actions/setup-node@v2 with: node-version: "16.x" + - name: Install Mockoon CLI run: npm install -D @mockoon/cli + - name: Install perl dependencies uses: shogo82148/actions-setup-perl@v1 with: @@ -38,8 +46,10 @@ jobs: Storable URI URI::Encode + - name: Run Mockoon CLI run: npx mockoon-cli start --data tests/resources/mockoon/cloud-aws-cloudtrail.json --port 3000 + - name: Run plugin run: | sudo chmod -R +x tests/functional/ diff --git a/doc/CI.md b/doc/CI.md index 39d63d14c..935df4b9b 100644 --- a/doc/CI.md +++ b/doc/CI.md @@ -90,12 +90,6 @@ The following files are included by default: * centreon/plugins/templates/hardware.pm, * centreon/plugins/values.pm. -Extra entries can be used, for example to make a package obsoleting another one: - -```bash - "custom_pkg_data": "Obsoletes: centreon-plugin-Old-Plugin", -``` - #### Create package dependencies management files In the previously created directory, create two new JSON files named *rpm.json* and *deb.json*. @@ -126,6 +120,14 @@ Example of *deb.json* file: } ``` +Extra entries can be used in *rpm.json* and *deb.json*, for example to make a package obsoleting another one: + +```bash + "conflicts": "centreon-plugin-Old-Plugin", + "replaces": "centreon-plugin-Old-Plugin", + "provides": "centreon-plugin-Old-Plugin", +``` + ### Commit and push changes In the project directory, create a new branch: diff --git a/packaging/centreon-plugin-Applications-Cisco-Ssms-Restapi/deb.json b/packaging/centreon-plugin-Applications-Cisco-Ssms-Restapi/deb.json index ea676ec3b..45b046e52 100644 --- a/packaging/centreon-plugin-Applications-Cisco-Ssms-Restapi/deb.json +++ b/packaging/centreon-plugin-Applications-Cisco-Ssms-Restapi/deb.json @@ -1,5 +1,6 @@ { - "dependencies": [ - ], - "custom_pkg_data": "Provides: centreon-plugin-network-cisco-ssms-restapi\\nReplaces: centreon-plugin-network-cisco-ssms-restapi\\nConflicts: centreon-plugin-network-cisco-ssms-restapi" + "dependencies": [], + "provides": ["centreon-plugin-network-cisco-ssms-restapi"], + "replaces": ["centreon-plugin-network-cisco-ssms-restapi"], + "conflicts": ["centreon-plugin-network-cisco-ssms-restapi"] } diff --git a/packaging/centreon-plugin-Applications-Cisco-Ssms-Restapi/rpm.json b/packaging/centreon-plugin-Applications-Cisco-Ssms-Restapi/rpm.json index a25aaf290..26eca86cf 100644 --- a/packaging/centreon-plugin-Applications-Cisco-Ssms-Restapi/rpm.json +++ b/packaging/centreon-plugin-Applications-Cisco-Ssms-Restapi/rpm.json @@ -1,5 +1,5 @@ { "dependencies": [ ], - "custom_pkg_data": "Obsoletes: centreon-plugin-Network-Cisco-Ssms-Restapi" + "replaces": ["centreon-plugin-Network-Cisco-Ssms-Restapi"] } diff --git a/packaging/centreon-plugin-Applications-Databases-Elasticsearch/rpm.json b/packaging/centreon-plugin-Applications-Databases-Elasticsearch/rpm.json index 081c4492e..de40ab39e 100644 --- a/packaging/centreon-plugin-Applications-Databases-Elasticsearch/rpm.json +++ b/packaging/centreon-plugin-Applications-Databases-Elasticsearch/rpm.json @@ -1,5 +1,4 @@ { - "dependencies": [ - ], - "custom_pkg_data": "Obsoletes: centreon-plugin-Applications-Elasticsearch" + "dependencies": [], + "replaces": ["centreon-plugin-Applications-Elasticsearch"] } diff --git a/packaging/centreon-plugin-Applications-Monitoring-Centreon-Central/rpm.json b/packaging/centreon-plugin-Applications-Monitoring-Centreon-Central/rpm.json index 29a41817c..5b96ec51d 100644 --- a/packaging/centreon-plugin-Applications-Monitoring-Centreon-Central/rpm.json +++ b/packaging/centreon-plugin-Applications-Monitoring-Centreon-Central/rpm.json @@ -6,5 +6,5 @@ "perl(DBI)", "perl(DBD::mysql)" ], - "custom_pkg_data": "Obsoletes: centreon-plugin-meta" + "replaces": ["centreon-plugin-meta"] } diff --git a/packaging/centreon-plugin-Applications-Protocol-Snmp/rpm.json b/packaging/centreon-plugin-Applications-Protocol-Snmp/rpm.json index 375ecc290..d5d2dad22 100644 --- a/packaging/centreon-plugin-Applications-Protocol-Snmp/rpm.json +++ b/packaging/centreon-plugin-Applications-Protocol-Snmp/rpm.json @@ -4,5 +4,5 @@ "perl(Digest::MD5)", "perl(NetAddr::IP)" ], - "custom_pkg_data": "Obsoletes: centreon-plugin-Generic-Snmp" + "replaces": ["centreon-plugin-Generic-Snmp"] } diff --git a/packaging/centreon-plugin-Applications-Video-Openheadend-Snmp/rpm.json b/packaging/centreon-plugin-Applications-Video-Openheadend-Snmp/rpm.json index c9ec37470..c43a75efc 100644 --- a/packaging/centreon-plugin-Applications-Video-Openheadend-Snmp/rpm.json +++ b/packaging/centreon-plugin-Applications-Video-Openheadend-Snmp/rpm.json @@ -2,5 +2,5 @@ "dependencies": [ "perl(SNMP)" ], - "custom_pkg_data": "Obsoletes: centreon-plugin-App-Video-Openheadend-Snmp" + "replaces": ["centreon-plugin-App-Video-Openheadend-Snmp"] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Cloudwatch-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Cloudwatch-Api/rpm.json index 8567b0aed..5c2153a42 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Cloudwatch-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Cloudwatch-Api/rpm.json @@ -2,5 +2,5 @@ "dependencies": [ "perl(DateTime)" ], - "custom_pkg_data": "Obsoletes: centreon-plugin-Cloud-Aws-Api" + "replaces": ["centreon-plugin-Cloud-Aws-Api"] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Cloudwatchlogs-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Cloudwatchlogs-Api/rpm.json index 8567b0aed..5c2153a42 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Cloudwatchlogs-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Cloudwatchlogs-Api/rpm.json @@ -2,5 +2,5 @@ "dependencies": [ "perl(DateTime)" ], - "custom_pkg_data": "Obsoletes: centreon-plugin-Cloud-Aws-Api" + "replaces": ["centreon-plugin-Cloud-Aws-Api"] } diff --git a/packaging/centreon-plugin-Cloud-Azure-Compute-VirtualMachine-Api/rpm.json b/packaging/centreon-plugin-Cloud-Azure-Compute-VirtualMachine-Api/rpm.json index c0efb95f2..3ce160382 100644 --- a/packaging/centreon-plugin-Cloud-Azure-Compute-VirtualMachine-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Azure-Compute-VirtualMachine-Api/rpm.json @@ -3,5 +3,5 @@ "perl(DateTime)", "perl(Digest::SHA)" ], - "custom_pkg_data": "Obsoletes: centreon-plugin-Cloud-Azure-Compute-Api" + "replaces": ["centreon-plugin-Cloud-Azure-Compute-Api"] } diff --git a/packaging/centreon-plugin-Cloud-Azure-Management-Monitor-Api/rpm.json b/packaging/centreon-plugin-Cloud-Azure-Management-Monitor-Api/rpm.json index a0823edd7..5bfcbcc4e 100644 --- a/packaging/centreon-plugin-Cloud-Azure-Management-Monitor-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Azure-Management-Monitor-Api/rpm.json @@ -3,5 +3,5 @@ "perl(DateTime)", "perl(Digest::SHA)" ], - "custom_pkg_data": "Obsoletes: centreon-plugin-Cloud-Azure-Monitor-Api" + "replaces": ["centreon-plugin-Cloud-Azure-Monitor-Api"] } diff --git a/packaging/centreon-plugin-Cloud-Azure-Management-Resource-Api/rpm.json b/packaging/centreon-plugin-Cloud-Azure-Management-Resource-Api/rpm.json index 44d3e16bc..550ef83b6 100644 --- a/packaging/centreon-plugin-Cloud-Azure-Management-Resource-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Azure-Management-Resource-Api/rpm.json @@ -5,5 +5,5 @@ "perl(DateTime-Format-Duration-ISO8601)", "perl(DateTime::Duration)" ], - "custom_pkg_data": "Obsoletes: centreon-plugin-Cloud-Azure-Resources-Api" + "replaces": ["centreon-plugin-Cloud-Azure-Resources-Api"] } diff --git a/packaging/centreon-plugin-Cloud-Azure-Network-LoadBalancer-Api/rpm.json b/packaging/centreon-plugin-Cloud-Azure-Network-LoadBalancer-Api/rpm.json index c081bd37b..aadee4b28 100644 --- a/packaging/centreon-plugin-Cloud-Azure-Network-LoadBalancer-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Azure-Network-LoadBalancer-Api/rpm.json @@ -3,5 +3,5 @@ "perl(DateTime)", "perl(Digest::SHA)" ], - "custom_pkg_data": "Obsoletes: centreon-plugin-Cloud-Azure-Nework-LoadBalancer-Api" + "replaces": ["centreon-plugin-Cloud-Azure-Nework-LoadBalancer-Api"] } diff --git a/packaging/centreon-plugin-Cloud-Azure-Network-NetworkInterface-Api/rpm.json b/packaging/centreon-plugin-Cloud-Azure-Network-NetworkInterface-Api/rpm.json index 0bea580f7..4751b72df 100644 --- a/packaging/centreon-plugin-Cloud-Azure-Network-NetworkInterface-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Azure-Network-NetworkInterface-Api/rpm.json @@ -3,5 +3,5 @@ "perl(DateTime)", "perl(Digest::SHA)" ], - "custom_pkg_data": "Obsoletes: centreon-plugin-Cloud-Azure-Network-Api" + "replaces": ["centreon-plugin-Cloud-Azure-Network-Api"] } diff --git a/packaging/centreon-plugin-Cloud-Azure-Storage-StorageAccount-Api/rpm.json b/packaging/centreon-plugin-Cloud-Azure-Storage-StorageAccount-Api/rpm.json index 93cea7bce..09b1ce3d9 100644 --- a/packaging/centreon-plugin-Cloud-Azure-Storage-StorageAccount-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Azure-Storage-StorageAccount-Api/rpm.json @@ -3,5 +3,5 @@ "perl(DateTime)", "perl(Digest::SHA)" ], - "custom_pkg_data": "Obsoletes: centreon-plugin-Cloud-Azure-Storage-Api" + "replaces": ["centreon-plugin-Cloud-Azure-Storage-Api"] } diff --git a/packaging/centreon-plugin-Hardware-Devices-Masterclock-Ntp100gps-Snmp/deb.json b/packaging/centreon-plugin-Hardware-Devices-Masterclock-Ntp100gps-Snmp/deb.json index 663aaaceb..466d3067f 100644 --- a/packaging/centreon-plugin-Hardware-Devices-Masterclock-Ntp100gps-Snmp/deb.json +++ b/packaging/centreon-plugin-Hardware-Devices-Masterclock-Ntp100gps-Snmp/deb.json @@ -1,5 +1,8 @@ { "dependencies": [ "libsnmp-perl" - ] + ], + "replaces": ["centreon-plugin-hardware-devices-masterclock-ntpserver-snmp"], + "conflicts": ["centreon-plugin-hardware-devices-masterclock-ntpserver-snmp"], + "provides": ["centreon-plugin-hardware-devices-masterclock-ntpserver-snmp"] } \ No newline at end of file diff --git a/packaging/centreon-plugin-Hardware-Devices-Masterclock-Ntp100gps-Snmp/pkg.json b/packaging/centreon-plugin-Hardware-Devices-Masterclock-Ntp100gps-Snmp/pkg.json index 91188f550..fe31a073a 100644 --- a/packaging/centreon-plugin-Hardware-Devices-Masterclock-Ntp100gps-Snmp/pkg.json +++ b/packaging/centreon-plugin-Hardware-Devices-Masterclock-Ntp100gps-Snmp/pkg.json @@ -7,6 +7,5 @@ "centreon/plugins/snmp.pm", "snmp_standard/mode/uptime.pm", "hardware/devices/masterclock/ntp100gps/snmp/" - ], - "custom_pkg_data": "Obsoletes: centreon-plugin-Hardware-Devices-Masterclock-Ntpserver-Snmp" + ] } diff --git a/packaging/centreon-plugin-Hardware-Devices-Masterclock-Ntp100gps-Snmp/rpm.json b/packaging/centreon-plugin-Hardware-Devices-Masterclock-Ntp100gps-Snmp/rpm.json index 418a331fc..a8251d1d4 100644 --- a/packaging/centreon-plugin-Hardware-Devices-Masterclock-Ntp100gps-Snmp/rpm.json +++ b/packaging/centreon-plugin-Hardware-Devices-Masterclock-Ntp100gps-Snmp/rpm.json @@ -1,5 +1,8 @@ { "dependencies": [ "perl(SNMP)" - ] + ], + "replaces": ["centreon-plugin-Hardware-Devices-Masterclock-Ntpserver-Snmp"], + "conflicts": ["centreon-plugin-Hardware-Devices-Masterclock-Ntpserver-Snmp"], + "provides": ["centreon-plugin-Hardware-Devices-Masterclock-Ntpserver-Snmp"] } \ No newline at end of file diff --git a/packaging/centreon-plugin-Hardware-Servers-Hp-Ilo-Xmlapi/rpm.json b/packaging/centreon-plugin-Hardware-Servers-Hp-Ilo-Xmlapi/rpm.json index c48ecbe12..1e0d1bc44 100644 --- a/packaging/centreon-plugin-Hardware-Servers-Hp-Ilo-Xmlapi/rpm.json +++ b/packaging/centreon-plugin-Hardware-Servers-Hp-Ilo-Xmlapi/rpm.json @@ -2,5 +2,5 @@ "dependencies": [ "perl(XML::Simple)" ], - "custom_pkg_data": "Obsoletes: centreon-plugin-Hardware-Servers-Hp-Ilo-Xmlapii" + "replaces": ["centreon-plugin-Hardware-Servers-Hp-Ilo-Xmlapii"] } diff --git a/packaging/centreon-plugin-Hardware-Servers-Ibm-Imm-Snmp/pkg.json b/packaging/centreon-plugin-Hardware-Servers-Ibm-Imm-Snmp/pkg.json index ff1fbfbce..1eea5349f 100644 --- a/packaging/centreon-plugin-Hardware-Servers-Ibm-Imm-Snmp/pkg.json +++ b/packaging/centreon-plugin-Hardware-Servers-Ibm-Imm-Snmp/pkg.json @@ -8,5 +8,5 @@ "hardware/server/ibm/mgmt_cards/imm/snmp/", "snmp_standard/mode/ntp.pm" ], - "custom_pkg_data": "Obsoletes: centreon-plugin-Hardware-servers-ibm-imm-snmp" + "replaces": ["centreon-plugin-Hardware-servers-ibm-imm-snmp"] } diff --git a/packaging/centreon-plugin-Hardware-Storage-Oracle-Zs-Snmp/rpm.json b/packaging/centreon-plugin-Hardware-Storage-Oracle-Zs-Snmp/rpm.json index 6521e014c..d8fe0c663 100644 --- a/packaging/centreon-plugin-Hardware-Storage-Oracle-Zs-Snmp/rpm.json +++ b/packaging/centreon-plugin-Hardware-Storage-Oracle-Zs-Snmp/rpm.json @@ -2,5 +2,5 @@ "dependencies": [ "perl(SNMP)" ], - "custom_pkg_data": "Obsoletes: centreon-plugin-Hardware-Storage-Oracle-Zfs-Snmp" + "replaces": ["centreon-plugin-Hardware-Storage-Oracle-Zfs-Snmp"] } diff --git a/packaging/centreon-plugin-Network-Cisco-Meraki-Restapi/rpm.json b/packaging/centreon-plugin-Network-Cisco-Meraki-Restapi/rpm.json index 6faebba48..a26b8b792 100644 --- a/packaging/centreon-plugin-Network-Cisco-Meraki-Restapi/rpm.json +++ b/packaging/centreon-plugin-Network-Cisco-Meraki-Restapi/rpm.json @@ -1,5 +1,5 @@ { "dependencies": [ ], - "custom_pkg_data": "Obsoletes: centreon-plugin-Network-Cisco-Meraki-Restap" + "replaces": ["centreon-plugin-Network-Cisco-Meraki-Restap"] } diff --git a/packaging/centreon-plugin-Network-Fritzbox-Upnp/rpm.json b/packaging/centreon-plugin-Network-Fritzbox-Upnp/rpm.json index 966c72f22..4b8358cc9 100644 --- a/packaging/centreon-plugin-Network-Fritzbox-Upnp/rpm.json +++ b/packaging/centreon-plugin-Network-Fritzbox-Upnp/rpm.json @@ -4,5 +4,5 @@ "perl(DateTime)", "perl(Digest::SHA)" ], - "custom_pkg_data": "Obsoletes: centreon-plugin-Network-Fritzbox" + "replaces": ["centreon-plugin-Network-Fritzbox"] } diff --git a/packaging/centreon-plugin-Operatingsystems-Hpux-Snmp/rpm.json b/packaging/centreon-plugin-Operatingsystems-Hpux-Snmp/rpm.json index c7f3ac25e..321f881cb 100644 --- a/packaging/centreon-plugin-Operatingsystems-Hpux-Snmp/rpm.json +++ b/packaging/centreon-plugin-Operatingsystems-Hpux-Snmp/rpm.json @@ -3,5 +3,5 @@ "perl(SNMP)", "perl(DateTime)" ], - "custom_pkg_data": "Obsoletes: centreon-plugin-Operatingsystems-Hpuux-Snmp" + "replaces": ["centreon-plugin-Operatingsystems-Hpuux-Snmp"] }