diff --git a/.github/actions/delivery/action.yml b/.github/actions/delivery/action.yml index 24ec39cbc6b..757034c9c60 100644 --- a/.github/actions/delivery/action.yml +++ b/.github/actions/delivery/action.yml @@ -31,12 +31,12 @@ runs: - name: Build name for DEB shell: bash - if: ${{ inputs.distrib == 'bullseye' || inputs.distrib == 'bookworm' }} + if: ${{ contains(fromJSON('["bullseye", "bookworm", "jammy"]' , inputs.distrib) }} run: | echo "extfile=deb" >> $GITHUB_ENV - name: Use cache files - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 + uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 with: path: ./*.${{ env.extfile }} key: ${{ inputs.cache_key }} @@ -46,7 +46,7 @@ runs: JF_URL: https://centreon.jfrog.io JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }} - - if: ${{ startsWith(inputs.distrib, 'el') }} + - if: ${{ env.extfile == 'rpm' }} name: Publish RPMs run: | FILES="*.${{ env.extfile }}" @@ -89,7 +89,7 @@ runs: done shell: bash - - if: ${{ inputs.distrib == 'bullseye' || inputs.distrib == 'bookworm' }} + - if: ${{ env.extfile == 'deb' }} name: Publish DEBs run: | FILES="*.${{ env.extfile }}" @@ -113,6 +113,12 @@ runs: echo "[DEBUG] - Version: $VERSION" - jf rt upload "$FILE" "apt-standard-${{ inputs.version }}-${{ inputs.stability }}/pool/${{ inputs.module_name }}/" --deb "${{ inputs.distrib }}/main/$ARCH" + if [[ "${{ inputs.distrib }}" == "jammy" ]]; then + REPO_PREFIX="ubuntu" + else + REPO_PREFIX="apt" + fi + + jf rt upload "$FILE" "${REPO_PREFIX}-standard-${{ inputs.version }}-${{ inputs.stability }}/pool/${{ inputs.module_name }}/" --deb "${{ inputs.distrib }}/main/$ARCH" done shell: bash diff --git a/.github/actions/package/action.yml b/.github/actions/package/action.yml index 921e54dd9c9..b51c1ae496e 100644 --- a/.github/actions/package/action.yml +++ b/.github/actions/package/action.yml @@ -62,9 +62,9 @@ runs: else export DIST="" if [ "${{ inputs.stability }}" = "unstable" ] || [ "${{ inputs.stability }}" = "canary" ]; then - export RELEASE="$RELEASE-${{ inputs.distrib }}" - elif [ "${{ inputs.stability }}" = "testing" ]; then - export RELEASE="1-${{ inputs.distrib }}" + export RELEASE="$RELEASE~${{ inputs.distrib }}" + else + export RELEASE="1~${{ inputs.distrib }}" fi fi @@ -87,7 +87,7 @@ runs: shell: bash - name: Cache packages - uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 + uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 with: path: ./*.${{ inputs.package_extension }} key: ${{ inputs.cache_key }} diff --git a/.github/actions/promote-to-stable/action.yml b/.github/actions/promote-to-stable/action.yml index 59470cc983a..54eba4d3b13 100644 --- a/.github/actions/promote-to-stable/action.yml +++ b/.github/actions/promote-to-stable/action.yml @@ -78,7 +78,7 @@ runs: shell: bash - name: Promote DEB packages to stable - if: ${{ startsWith(inputs.distrib, 'bullseye') || startsWith(inputs.distrib, 'bookworm') }} + if: ${{ contains(fromJSON('["bullseye", "bookworm"]' , inputs.distrib) }} run: | echo "[DEBUG] - Major version: ${{ inputs.major_version }}" echo "[DEBUG] - Minor version: ${{ inputs.minor_version }}" diff --git a/.github/docker/Dockerfile.centreon-collect-alma8 b/.github/docker/Dockerfile.centreon-collect-alma8 index 5e09d3a516b..6fbfc962d31 100644 --- a/.github/docker/Dockerfile.centreon-collect-alma8 +++ b/.github/docker/Dockerfile.centreon-collect-alma8 @@ -2,7 +2,7 @@ ARG REGISTRY_URL FROM ${REGISTRY_URL}/almalinux:8 -RUN <> /etc/yum.conf && \ @@ -55,6 +55,8 @@ dnf install -y cmake \ dnf update libarchive +dnf clean all + pip3 install conan==1.61.0 --prefix=/usr --upgrade rm -rf ~/.conan/profiles/default @@ -62,7 +64,7 @@ EOF COPY conanfile.txt . -RUN <> /etc/yum.conf @@ -48,6 +48,8 @@ dnf --best install -y cmake \ nfpm \ sudo +dnf clean all + pip3 install conan==1.61.0 --prefix=/usr --upgrade rm -rf ~/.conan/profiles/default @@ -55,7 +57,7 @@ EOF COPY conanfile.txt . -RUN <> /etc/yum.conf @@ -38,6 +38,8 @@ dnf --best install -y \ psmisc \ sudo +dnf clean all + echo "install robot and dependencies" pip3 install -U robotframework robotframework-databaselibrary robotframework-httpctrl robotframework-examples pymysql python-dateutil psutil diff --git a/.github/docker/Dockerfile.centreon-collect-debian-bookworm b/.github/docker/Dockerfile.centreon-collect-debian-bookworm index d0d88aeab7b..1a3fea0b1e3 100644 --- a/.github/docker/Dockerfile.centreon-collect-debian-bookworm +++ b/.github/docker/Dockerfile.centreon-collect-debian-bookworm @@ -2,7 +2,7 @@ ARG REGISTRY_URL FROM ${REGISTRY_URL}/debian:bookworm -RUN <> /etc/yum.conf @@ -48,6 +48,8 @@ dnf --best install -y cmake \ nfpm \ sudo +dnf clean all + pip3 install conan==1.61.0 --prefix=/usr --upgrade rm -rf ~/.conan/profiles/default @@ -55,7 +57,7 @@ EOF COPY conanfile.txt . -RUN <> /etc/yum.conf @@ -38,6 +38,8 @@ dnf --best install -y gcc \ sudo \ iproute +dnf clean all + echo "install robot and dependencies" pip3 install -U robotframework robotframework-databaselibrary robotframework-httpctrl robotframework-examples pymysql python-dateutil psutil diff --git a/.github/docker/Dockerfile.centreon-collect-ubuntu-jammy b/.github/docker/Dockerfile.centreon-collect-ubuntu-jammy new file mode 100644 index 00000000000..8a85e5f7f65 --- /dev/null +++ b/.github/docker/Dockerfile.centreon-collect-ubuntu-jammy @@ -0,0 +1,59 @@ +ARG REGISTRY_URL + +FROM ${REGISTRY_URL}/ubuntu:jammy + +RUN bash -e < /tmp/centreon.sql @@ -58,7 +58,11 @@ cat resources/centreon.sql | sed "s/DBNameConf/centreon/g" > /tmp/centreon.sql mysql -u root_centreon -pcentreon < resources/centreon_storage.sql mysql -u root_centreon -pcentreon < /tmp/centreon.sql -cd tests +if [ $database_type == 'mysql' ]; then + killall -w mysqldtoto +else + killall -w mariadbd +fi if [ "$distrib" = "ALMALINUX" ]; then dnf groupinstall -y "Development Tools" @@ -68,28 +72,3 @@ else apt-get install -y build-essential apt-get install -y python3-dev fi - - -echo "########################## Install centreon collect ###########################" -cd .. -echo "Installation..." -if [ "$distrib" = "ALMALINUX" ]; then - dnf clean all - rm -f ./*-selinux-*.rpm # avoid to install selinux packages which are dependent to centreon-common-selinux - dnf install -y ./*.rpm -else - apt-get update -# apt-get install -y ./*.deb -fi - - -if [ $database_type == 'mysql' ]; then - killall -w mysqldtoto -else - killall -w mariadbd -fi - -cd .. - -\rm -rf * - diff --git a/.github/scripts/collect-unit-tests.sh b/.github/scripts/collect-unit-tests.sh index 6ccf25a4b2c..a9a95f8e173 100755 --- a/.github/scripts/collect-unit-tests.sh +++ b/.github/scripts/collect-unit-tests.sh @@ -7,7 +7,9 @@ mkdir /src/build cd /src/build/ conan install .. -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build=missing -if [ $(cat /etc/issue | awk '{print $1}') = "Debian" ] ; then + +OS_ID=$(cat /etc/issue | awk '{print $1}') +if [[ "$OS_ID" == "Debian" || "$OS_ID" == "Ubuntu" ]] ; then CXXFLAGS="-Wall -Wextra" cmake -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DWITH_CENTREON_CLIB_INCLUDE_DIR=../clib/inc/ -DWITH_CENTREON_CLIB_LIBRARIES=centreon-clib/libcentreon_clib.so -DCMAKE_BUILD_TYPE=Debug -DWITH_PREFIX=/usr -DWITH_PREFIX_BIN=/usr/sbin -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_PREFIX_MODULES=/usr/share/centreon/lib/centreon-broker -DWITH_PREFIX_CONF_BROKER=/etc/centreon-broker -DWITH_PREFIX_LIB_BROKER=/usr/lib64/nagios -DWITH_PREFIX_CONF_ENGINE=/etc/centreon-engine -DWITH_PREFIX_LIB_ENGINE=/usr/lib64/centreon-engine -DWITH_PREFIX_LIB_CLIB=/usr/lib64/ -DWITH_RW_DIR=/var/lib/centreon-engine/rw -DWITH_VAR_DIR=/var/log/centreon-engine -DWITH_MODULE_SIMU=On -DNG=On .. else CXXFLAGS="-Wall -Wextra" cmake3 -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DWITH_CENTREON_CLIB_INCLUDE_DIR=../clib/inc/ -DWITH_CENTREON_CLIB_LIBRARIES=centreon-clib/libcentreon_clib.so -DCMAKE_BUILD_TYPE=Debug -DWITH_PREFIX=/usr -DWITH_PREFIX_BIN=/usr/sbin -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_PREFIX_MODULES=/usr/share/centreon/lib/centreon-broker -DWITH_PREFIX_CONF_BROKER=/etc/centreon-broker -DWITH_PREFIX_LIB_BROKER=/usr/lib64/nagios -DWITH_PREFIX_CONF_ENGINE=/etc/centreon-engine -DWITH_PREFIX_LIB_ENGINE=/usr/lib64/centreon-engine -DWITH_PREFIX_LIB_CLIB=/usr/lib64/ -DWITH_RW_DIR=/var/lib/centreon-engine/rw -DWITH_VAR_DIR=/var/log/centreon-engine -DWITH_MODULE_SIMU=On -DNG=On .. diff --git a/.github/workflows/centreon-collect.yml b/.github/workflows/centreon-collect.yml index c2b2e6ad90e..7c9ae6aaeae 100644 --- a/.github/workflows/centreon-collect.yml +++ b/.github/workflows/centreon-collect.yml @@ -135,7 +135,7 @@ jobs: distrib: ${{ matrix.distrib }} version: ${{ needs.get-version.outputs.version }} artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: cache-${{ github.sha }}-rpm-centreon-collect-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }} + cache_key: ${{ github.run_id }}-${{ github.sha }}-rpm-centreon-collect-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }} stability: ${{ needs.get-version.outputs.stability }} deliver-deb: @@ -152,6 +152,8 @@ jobs: arch: arm64 - distrib: bookworm arch: amd64 + - distrib: jammy + arch: amd64 name: deliver ${{ matrix.distrib }} @@ -160,14 +162,13 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Publish DEB packages - if: ${{ !contains('bookworm', matrix.distrib) || !startsWith('22.', needs.get-version.outputs.version) || !startsWith('23.', needs.get-version.outputs.version) }} uses: ./.github/actions/delivery with: module_name: collect distrib: ${{ matrix.distrib }} version: ${{ needs.get-version.outputs.version }} artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: cache-${{ github.sha }}-deb-centreon-collect-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }} + cache_key: ${{ github.run_id }}-${{ github.sha }}-deb-centreon-collect-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }} stability: ${{ needs.get-version.outputs.stability }} promote: @@ -176,7 +177,7 @@ jobs: runs-on: [self-hosted, common] strategy: matrix: - distrib: [el8, el9, bullseye, bookworm] + distrib: [el8, el9, bullseye, bookworm, jammy] steps: - name: Checkout sources diff --git a/.github/workflows/docker-builder.yml b/.github/workflows/docker-builder.yml index 4b50dc9a602..6824ed50c02 100644 --- a/.github/workflows/docker-builder.yml +++ b/.github/workflows/docker-builder.yml @@ -59,6 +59,14 @@ jobs: dockerfile: centreon-collect-debian-bookworm image: centreon-collect-debian-bookworm tag: ${{ needs.get-version.outputs.img_version }} + - runner: collect + dockerfile: centreon-collect-debian-bookworm-test + image: centreon-collect-debian-bookworm-test + tag: ${{ needs.get-version.outputs.test_img_version }} + - runner: collect + dockerfile: centreon-collect-ubuntu-jammy + image: centreon-collect-ubuntu-jammy + tag: ${{ needs.get-version.outputs.img_version }} - runner: collect-arm64 dockerfile: centreon-collect-debian-bullseye image: centreon-collect-debian-bullseye-arm64 diff --git a/.github/workflows/package-collect.yml b/.github/workflows/package-collect.yml index e0c219eb331..621f2635e78 100644 --- a/.github/workflows/package-collect.yml +++ b/.github/workflows/package-collect.yml @@ -45,6 +45,11 @@ jobs: package_extension: deb runner: collect arch: amd64 + - image: centreon-collect-ubuntu-jammy + distrib: jammy + package_extension: deb + runner: collect + arch: amd64 - image: centreon-collect-debian-bullseye-arm64 distrib: bullseye package_extension: deb @@ -171,7 +176,7 @@ jobs: release: ${{ inputs.release }} arch: ${{ matrix.arch }} commit_hash: ${{ inputs.commit_hash }} - cache_key: cache-${{ github.sha }}-${{ matrix.package_extension}}-centreon-collect-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }} + cache_key: ${{ github.run_id }}-${{ github.sha }}-${{ matrix.package_extension}}-centreon-collect-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }} 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 }} diff --git a/.github/workflows/robot-nightly.yml b/.github/workflows/robot-nightly.yml index 9c77b7b4826..13db94f259a 100644 --- a/.github/workflows/robot-nightly.yml +++ b/.github/workflows/robot-nightly.yml @@ -82,8 +82,16 @@ jobs: package_extension: deb arch: arm64 database_type: mariadb - test_group_name: robot_test-mariadb-el9-arm64 + test_group_name: robot_test-mariadb-bullseye-arm64 tests_params: '{}' + # uncomment once bbdo-protobuf.robot test is fixed + # - distrib: bookworm + # image: centreon-collect-debian-bookworm-test + # package_extension: deb + # arch: amd64 + # database_type: mariadb + # test_group_name: robot_test-mariadb-bookworm-amd64 + # tests_params: '{}' - distrib: el9 image: centreon-collect-alma9-test package_extension: rpm @@ -101,7 +109,7 @@ jobs: image: ${{ matrix.image }} image_test: ${{ matrix.image }}:${{ needs.get-version.outputs.test_img_version }} image_version: ${{ needs.get-version.outputs.img_version }} - package_cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-centreon-collect-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }} + package_cache_key: ${{ github.run_id }}-${{ github.sha }}-${{ matrix.package_extension }}-centreon-collect-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }} package_cache_path: ./*.${{ matrix.package_extension}} database_type: ${{ matrix.database_type }} tests_params: ${{matrix.tests_params}} @@ -132,7 +140,7 @@ jobs: distrib: ${{ matrix.distrib }} version: ${{ needs.get-version.outputs.version }} artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: cache-${{ github.sha }}-rpm-centreon-collect-${{ matrix.distrib }}-amd64-${{ github.head_ref || github.ref_name }} + cache_key: ${{ github.run_id }}-${{ github.sha }}-rpm-centreon-collect-${{ matrix.distrib }}-amd64-${{ github.head_ref || github.ref_name }} stability: ${{ needs.get-version.outputs.stability }} deliver-deb: @@ -146,6 +154,8 @@ jobs: arch: amd64 - distrib: bookworm arch: amd64 + - distrib: jammy + arch: amd64 - distrib: bullseye arch: arm64 name: deliver ${{ matrix.distrib }} @@ -155,12 +165,11 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Publish DEB packages - if: ${{ !contains('bookworm', matrix.distrib) || !startsWith('22.', needs.get-version.outputs.version) || !startsWith('23.', needs.get-version.outputs.version) }} uses: ./.github/actions/delivery with: module_name: collect distrib: ${{ matrix.distrib }} version: ${{ needs.get-version.outputs.version }} artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: cache-${{ github.sha }}-deb-centreon-collect-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }} + cache_key: ${{ github.run_id }}-${{ github.sha }}-deb-centreon-collect-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }} stability: ${{ needs.get-version.outputs.stability }}