Skip to content

Commit

Permalink
Bump 4.9.2 rev 00 (#7126)
Browse files Browse the repository at this point in the history
* chore: bump 4.9.2 rev 00

* chore(changelog): add entry

* feat(bump): add ability to edit the imposter specification file reference on bump script of main plugin
  • Loading branch information
Desvelao authored Oct 25, 2024
1 parent 1b64f9c commit b87b026
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to the Wazuh app project will be documented in this file.

## Wazuh v4.9.2 - OpenSearch Dashboards 2.13.0 - Revision 00

### Added

- Support for Wazuh 4.9.2

## Wazuh v4.9.1 - OpenSearch Dashboards 2.13.0 - Revision 04

### Added
Expand Down
2 changes: 1 addition & 1 deletion docker/imposter/wazuh-config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
plugin: openapi
specFile: https://raw.githubusercontent.com/wazuh/wazuh/master/api/api/spec/spec.yaml
specFile: https://raw.githubusercontent.com/wazuh/wazuh/4.9.2/api/api/spec/spec.yaml
system:
stores:
# this store is preloaded from file
Expand Down
2 changes: 1 addition & 1 deletion plugins/main/opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "wazuh",
"version": "4.9.1-04",
"version": "4.9.2-00",
"opensearchDashboardsVersion": "opensearchDashboards",
"configPath": ["wazuh"],
"requiredPlugins": [
Expand Down
4 changes: 2 additions & 2 deletions plugins/main/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "wazuh",
"version": "4.9.1",
"revision": "04",
"version": "4.9.2",
"revision": "00",
"pluginPlatform": {
"version": "2.13.0"
},
Expand Down
43 changes: 43 additions & 0 deletions plugins/main/scripts/release/bump.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,47 @@ const cli = require('../../../../scripts/lib/cli/cli')(
],
);

function updateImposterSpecificationReference(configuration, logger) {
try {
logger.debug('Editing imposter specification reference');
const fs = require('fs');
const path = require('path');
const specificationFile = path.join(
__dirname,
'../../../..',
'docker/imposter/wazuh-config.yml',
);

logger.debug(`Reading ${specificationFile} file`);
const content = fs.readFileSync(specificationFile, 'utf8');

const { version } = configuration;

if (!version) {
throw new Error('Version is not specified.');
}

// specFile: https://raw.githubusercontent.com/wazuh/wazuh/<BRANCH_VERSION>/api/api/spec/spec.yaml
const updatedContent = content.replace(
/specFile:\s+\S+/m,
`specFile: https://raw.githubusercontent.com/wazuh/wazuh/${version}/api/api/spec/spec.yaml`,
);

if (content !== updatedContent) {
logger.debug(
`Updating [${specificationFile}] imposter specification file with latest changes`,
);
fs.writeFileSync(specificationFile, updatedContent, 'utf8');
logger.info(`${specificationFile} file has been updated`);
} else {
logger.debug(`Nothing to change in ${specificationFile} file`);
}
} catch (error) {
logger.error(`Error editing the specification file: ${error.message}`);
process.exit(1);
}
}

function run(configuration, logger) {
let localConfiguration = {
...configuration,
Expand Down Expand Up @@ -90,6 +131,8 @@ function run(configuration, logger) {
);
process.exit(1);
}

updateImposterSpecificationReference(localConfiguration, logger);
}

const logger = require('../../../../scripts/release/lib/logger').create([
Expand Down
2 changes: 1 addition & 1 deletion plugins/wazuh-check-updates/opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "wazuhCheckUpdates",
"version": "4.9.1-04",
"version": "4.9.2-00",
"opensearchDashboardsVersion": "opensearchDashboards",
"server": true,
"ui": true,
Expand Down
4 changes: 2 additions & 2 deletions plugins/wazuh-check-updates/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "wazuh-check-updates",
"version": "4.9.1",
"revision": "04",
"version": "4.9.2",
"revision": "00",
"pluginPlatform": {
"version": "2.13.0"
},
Expand Down
2 changes: 1 addition & 1 deletion plugins/wazuh-core/opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "wazuhCore",
"version": "4.9.1-04",
"version": "4.9.2-00",
"opensearchDashboardsVersion": "opensearchDashboards",
"server": true,
"ui": true,
Expand Down
4 changes: 2 additions & 2 deletions plugins/wazuh-core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "wazuh-core",
"version": "4.9.1",
"revision": "04",
"version": "4.9.2",
"revision": "00",
"pluginPlatform": {
"version": "2.13.0"
},
Expand Down

0 comments on commit b87b026

Please sign in to comment.