diff --git a/.github/scripts/windows-agent-compile.ps1 b/.github/scripts/windows-agent-compile.ps1 index 02af28abb7e..831cf31f363 100644 --- a/.github/scripts/windows-agent-compile.ps1 +++ b/.github/scripts/windows-agent-compile.ps1 @@ -37,7 +37,7 @@ $file_name = "windows-agent-vcpkg-dependencies-cache-" + $vcpkg_hash.Hash $file_name_extension = "${file_name}.7z" #try to get compiled dependenciesfrom s3 -Write-Host "try to download compiled dependencies from s3" +Write-Host "try to download compiled dependencies from s3: $file_name_extension $file_name_extension" aws --quiet s3 cp s3://centreon-collect-robot-report/$file_name_extension $file_name_extension if ( $? -ne $true ) { #no => generate diff --git a/.github/workflows/get-version.yml b/.github/workflows/get-version.yml index faa283e5850..2ac04a47b19 100644 --- a/.github/workflows/get-version.yml +++ b/.github/workflows/get-version.yml @@ -192,7 +192,7 @@ jobs: esac case "$BRANCHNAME" in - develop | dev-[2-9][0-9].[0-9][0-9].x) + develop | dev-[2-9][0-9].[0-9][0-9].x | prepare-release-cloud*) STABILITY="unstable" ENV="development" ;; diff --git a/.github/workflows/windows-agent.yml b/.github/workflows/windows-agent.yml index eddbcd3c39c..3e6b132ab68 100644 --- a/.github/workflows/windows-agent.yml +++ b/.github/workflows/windows-agent.yml @@ -27,7 +27,13 @@ on: - vcpkg.json jobs: + get-version: + uses: ./.github/workflows/get-version.yml + with: + version_file: CMakeLists.txt + build-and-test-agent: + needs: [get-version] runs-on: windows-latest env: AWS_ACCESS_KEY_ID: ${{ secrets.COLLECT_S3_ACCESS_KEY }} @@ -61,9 +67,15 @@ jobs: with: path: centreon-monitoring-agent.zip key: ${{ github.run_id }}-${{ github.sha }}-CMA-${{ github.head_ref || github.ref_name }} + enableCrossOsArchive: ${{ true }} - name: Upload package artifacts - if: ${{ false }} + if: | + github.event_name != 'workflow_dispatch' && + contains(fromJson('["stable"]'), needs.get-version.outputs.stability) && + ! cancelled() && + ! contains(needs.*.result, 'failure') && + ! contains(needs.*.result, 'cancelled') uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 with: name: packages-centreon-monitoring-agent-windows diff --git a/.version b/.version index 4cb5b94d8d2..db9a189ef29 100644 --- a/.version +++ b/.version @@ -1,2 +1,2 @@ -MAJOR=24.07 +MAJOR=24.09 MINOR=0 diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ad78b344c8..51319732e2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,7 +118,7 @@ endif() # Version. set(COLLECT_MAJOR 24) -set(COLLECT_MINOR 07) +set(COLLECT_MINOR 09) set(COLLECT_PATCH 0) set(COLLECT_VERSION "${COLLECT_MAJOR}.${COLLECT_MINOR}.${COLLECT_PATCH}") diff --git a/agent/CMakeLists.txt b/agent/CMakeLists.txt index 09eb1737271..510a237da98 100644 --- a/agent/CMakeLists.txt +++ b/agent/CMakeLists.txt @@ -122,6 +122,10 @@ set( SRC_LINUX ${SRC_DIR}/config.cc ) +configure_file("${INCLUDE_DIR}/version.hh.in" + "${INCLUDE_DIR}/version.hh") + + if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") set(SRC ${SRC_COMMON} ${SRC_LINUX}) else() diff --git a/agent/inc/com/centreon/agent/version.hh.in b/agent/inc/com/centreon/agent/version.hh.in new file mode 100644 index 00000000000..f4c2d2e0136 --- /dev/null +++ b/agent/inc/com/centreon/agent/version.hh.in @@ -0,0 +1,28 @@ +/* + * Copyright 2012-2013,2019 Centreon (https://www.centreon.com/) + * + * 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 + * + * http://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. + * + * For more information : contact@centreon.com + * + */ + +#ifndef CCE_VERSION_HH +#define CCE_VERSION_HH + +// Compile-time values. +constexpr unsigned CENTREON_AGENT_VERSION_MAJOR = @COLLECT_MAJOR@; +constexpr unsigned CENTREON_AGENT_VERSION_MINOR = @COLLECT_MINOR@.0; +constexpr unsigned CENTREON_AGENT_VERSION_PATCH = @COLLECT_PATCH@.0; + +#endif // !CCE_VERSION_HH diff --git a/agent/src/streaming_client.cc b/agent/src/streaming_client.cc index 424d384b1c9..764f9be5769 100644 --- a/agent/src/streaming_client.cc +++ b/agent/src/streaming_client.cc @@ -19,6 +19,7 @@ #include "streaming_client.hh" #include "check_exec.hh" #include "com/centreon/common/defer.hh" +#include "version.hh" using namespace com::centreon::agent; @@ -145,10 +146,9 @@ void streaming_client::_create_reactor() { std::make_shared(); auto infos = who_i_am->mutable_init(); - infos->mutable_centreon_version()->set_major(COLLECT_MAJOR); - infos->mutable_centreon_version()->set_minor(COLLECT_MINOR); - infos->mutable_centreon_version()->set_patch(COLLECT_PATCH); - + infos->mutable_centreon_version()->set_major(CENTREON_AGENT_VERSION_MAJOR); + infos->mutable_centreon_version()->set_minor(CENTREON_AGENT_VERSION_MINOR); + infos->mutable_centreon_version()->set_patch(CENTREON_AGENT_VERSION_PATCH); infos->set_host(_supervised_host); _reactor->write(who_i_am); diff --git a/agent/src/streaming_server.cc b/agent/src/streaming_server.cc index 215c1d2457b..06a637e8b94 100644 --- a/agent/src/streaming_server.cc +++ b/agent/src/streaming_server.cc @@ -19,6 +19,7 @@ #include "streaming_server.hh" #include "check_exec.hh" #include "scheduler.hh" +#include "version.hh" using namespace com::centreon::agent; @@ -89,9 +90,9 @@ void server_reactor::_start() { std::make_shared(); auto infos = who_i_am->mutable_init(); - infos->mutable_centreon_version()->set_major(COLLECT_MAJOR); - infos->mutable_centreon_version()->set_minor(COLLECT_MINOR); - infos->mutable_centreon_version()->set_patch(COLLECT_PATCH); + infos->mutable_centreon_version()->set_major(CENTREON_AGENT_VERSION_MAJOR); + infos->mutable_centreon_version()->set_minor(CENTREON_AGENT_VERSION_MINOR); + infos->mutable_centreon_version()->set_patch(CENTREON_AGENT_VERSION_PATCH); infos->set_host(_supervised_host); write(who_i_am); diff --git a/broker/core/inc/com/centreon/broker/version.hh.in b/broker/core/inc/com/centreon/broker/version.hh.in index 62198225fdd..7c5fa84888e 100644 --- a/broker/core/inc/com/centreon/broker/version.hh.in +++ b/broker/core/inc/com/centreon/broker/version.hh.in @@ -23,9 +23,9 @@ namespace com::centreon::broker::version { // Compile-time values. - unsigned int const major = @COLLECT_MAJOR@; - unsigned int const minor = @COLLECT_MINOR@; - unsigned int const patch = @COLLECT_PATCH@; + constexpr unsigned major = @COLLECT_MAJOR@; + constexpr unsigned minor = @COLLECT_MINOR@.0; + constexpr unsigned patch = @COLLECT_PATCH@.0; char const* const string = "@CENTREON_BROKER_VERSION@"; } diff --git a/clib/inc/com/centreon/clib/version.hh.in b/clib/inc/com/centreon/clib/version.hh.in index ad0cf3b714c..21a8b9ff4e8 100644 --- a/clib/inc/com/centreon/clib/version.hh.in +++ b/clib/inc/com/centreon/clib/version.hh.in @@ -28,15 +28,9 @@ namespace com::centreon::clib { namespace version { // Compile-time values. -unsigned int const major = @COLLECT_MAJOR@; -unsigned int const minor = @COLLECT_MINOR@; -unsigned int const patch = @COLLECT_PATCH@; char const* const string = "@CLIB_VERSION@"; // Run-time values. -unsigned int get_major() noexcept; -unsigned int get_minor() noexcept; -unsigned int get_patch() noexcept; char const* get_string() noexcept; } // namespace version } // namespace com::centreon::clib diff --git a/clib/src/clib/version.cc b/clib/src/clib/version.cc index 5984cea7a44..14d1dfee4cf 100644 --- a/clib/src/clib/version.cc +++ b/clib/src/clib/version.cc @@ -1,51 +1,24 @@ /** -* Copyright 2011-2013 Centreon -* -* 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 -* -* http://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. -* -* For more information : contact@centreon.com -*/ - -#include "com/centreon/clib/version.hh" - -using namespace com::centreon::clib; - -/** - * Get version major. + * Copyright 2011-2013 Centreon * - * @return Centreon Clib version major. - */ -unsigned int version::get_major() throw() { - return (major); -} - -/** - * Get version minor. + * 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 * - * @return Centreon Clib version minor. - */ -unsigned int version::get_minor() throw() { - return (minor); -} - -/** - * Get version patch. + * http://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. * - * @return Centreon Clib version patch. + * For more information : contact@centreon.com */ -unsigned int version::get_patch() throw() { - return (patch); -} + +#include "com/centreon/clib/version.hh" + +using namespace com::centreon::clib; /** * Get version string. diff --git a/clib/test/version.cc b/clib/test/version.cc index 8f2b10e7a88..e24c7e60f34 100644 --- a/clib/test/version.cc +++ b/clib/test/version.cc @@ -1,41 +1,26 @@ /** -* Copyright 2011-2020 Centreon -* -* 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 -* -* http://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. -* -* For more information : contact@centreon.com -*/ + * Copyright 2011-2020 Centreon + * + * 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 + * + * http://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. + * + * For more information : contact@centreon.com + */ #include "com/centreon/clib/version.hh" #include using namespace com::centreon::clib; -TEST(ClibVersion, Major) { - ASSERT_EQ(version::get_major(), version::major); - ASSERT_EQ(CENTREON_CLIB_VERSION_MAJOR, version::major); -} - -TEST(ClibVersion, Minor) { - ASSERT_EQ(version::get_minor(), version::minor); - ASSERT_EQ(CENTREON_CLIB_VERSION_MINOR, version::minor); -} - -TEST(ClibVersion, Patch) { - ASSERT_EQ(version::get_patch(), version::patch); - ASSERT_EQ(CENTREON_CLIB_VERSION_PATCH, version::patch); -} - TEST(ClibVersion, String) { ASSERT_STREQ(version::get_string(), version::string); ASSERT_STREQ(CENTREON_CLIB_VERSION_STRING, version::string); diff --git a/engine/inc/com/centreon/engine/version.hh.in b/engine/inc/com/centreon/engine/version.hh.in index c6f1dd8ede7..2438a09458c 100644 --- a/engine/inc/com/centreon/engine/version.hh.in +++ b/engine/inc/com/centreon/engine/version.hh.in @@ -21,9 +21,9 @@ #define CCE_VERSION_HH // Compile-time values. -#define CENTREON_ENGINE_VERSION_MAJOR @COLLECT_MAJOR@ -#define CENTREON_ENGINE_VERSION_MINOR @COLLECT_MINOR@ -#define CENTREON_ENGINE_VERSION_PATCH @COLLECT_PATCH@ +constexpr unsigned CENTREON_ENGINE_VERSION_MAJOR = @COLLECT_MAJOR@; +constexpr unsigned CENTREON_ENGINE_VERSION_MINOR =@COLLECT_MINOR@.0; +constexpr unsigned CENTREON_ENGINE_VERSION_PATCH =@COLLECT_PATCH@.0; #define CENTREON_ENGINE_VERSION_STRING "@CENTREON_ENGINE_VERSION@" #endif // !CCE_VERSION_HH diff --git a/gorgone/packaging/centreon-gorgone-centreon-config.yaml b/gorgone/packaging/centreon-gorgone-centreon-config.yaml index f633c694fd1..1a8d3a48ce6 100644 --- a/gorgone/packaging/centreon-gorgone-centreon-config.yaml +++ b/gorgone/packaging/centreon-gorgone-centreon-config.yaml @@ -57,11 +57,11 @@ overrides: depends: - centreon-gorgone (= ${VERSION}-${RELEASE}${DIST}) replaces: - - centreon-gorgone (<< 24.07.0) + - centreon-gorgone (<< 24.09.0) deb: breaks: - - centreon-gorgone (<< 24.07.0) + - centreon-gorgone (<< 24.09.0) rpm: summary: Configure Centreon Gorgone for use with Centreon Web