Skip to content

Commit

Permalink
prepare-release-cloud-24.09.0 (#1648)
Browse files Browse the repository at this point in the history
* bump collect to 24.09.0

* chore(release) bump collect to 24.09.0

* chore(release) bump gorgone to 24.09.0

* remove unused get_major,get_minor, get_patch

* fix broker minor version

* fix engine minor version

* fix agent minor version

* fix(ci): handle prepare release cloud in stability

* deliver cma windows zip in centreon download

* release => upload in artifiacts

---------

Co-authored-by: Jean Christophe Roques <[email protected]>
Co-authored-by: tuntoja <[email protected]>
  • Loading branch information
3 people authored Sep 3, 2024
1 parent f91bec1 commit b4c47bc
Show file tree
Hide file tree
Showing 15 changed files with 97 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/windows-agent-compile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/get-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
;;
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/windows-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
MAJOR=24.07
MAJOR=24.09
MINOR=0
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand Down
4 changes: 4 additions & 0 deletions agent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
28 changes: 28 additions & 0 deletions agent/inc/com/centreon/agent/version.hh.in
Original file line number Diff line number Diff line change
@@ -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 : [email protected]
*
*/

#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 = @[email protected];
constexpr unsigned CENTREON_AGENT_VERSION_PATCH = @[email protected];

#endif // !CCE_VERSION_HH
8 changes: 4 additions & 4 deletions agent/src/streaming_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -145,10 +146,9 @@ void streaming_client::_create_reactor() {
std::make_shared<MessageFromAgent>();
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);
Expand Down
7 changes: 4 additions & 3 deletions agent/src/streaming_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "streaming_server.hh"
#include "check_exec.hh"
#include "scheduler.hh"
#include "version.hh"

using namespace com::centreon::agent;

Expand Down Expand Up @@ -89,9 +90,9 @@ void server_reactor::_start() {
std::make_shared<MessageFromAgent>();
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);
Expand Down
6 changes: 3 additions & 3 deletions broker/core/inc/com/centreon/broker/version.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@";
}

Expand Down
6 changes: 0 additions & 6 deletions clib/inc/com/centreon/clib/version.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
59 changes: 16 additions & 43 deletions clib/src/clib/version.cc
Original file line number Diff line number Diff line change
@@ -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 : [email protected]
*/

#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 : [email protected]
*/
unsigned int version::get_patch() throw() {
return (patch);
}

#include "com/centreon/clib/version.hh"

using namespace com::centreon::clib;

/**
* Get version string.
Expand Down
47 changes: 16 additions & 31 deletions clib/test/version.cc
Original file line number Diff line number Diff line change
@@ -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 : [email protected]
*/
* 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 : [email protected]
*/

#include "com/centreon/clib/version.hh"
#include <gtest/gtest.h>

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);
Expand Down
6 changes: 3 additions & 3 deletions engine/inc/com/centreon/engine/version.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions gorgone/packaging/centreon-gorgone-centreon-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b4c47bc

Please sign in to comment.