Removed README exception

This commit is contained in:
c-bordon
2025-04-15 16:37:41 -03:00
parent e161490f4d
commit 2e22add312
2 changed files with 18 additions and 49 deletions

View File

@@ -177,50 +177,7 @@ WAZUH_MONITORING_REPLICAS=0 ##
| Wazuh version | ODFE | XPACK | | Wazuh version | ODFE | XPACK |
|---------------|---------|--------| |---------------|---------|--------|
| v4.13.0 | | | | v4.3.0+ | N/A | N/A |
| v4.12.1 | | |
| v4.12.0 | | |
| v4.11.2 | | |
| v4.11.1 | | |
| v4.11.0 | | |
| v4.10.1 | | |
| v4.10.0 | | |
| v4.9.2 | | |
| v4.9.1 | | |
| v4.9.0 | | |
| v4.8.2 | | |
| v4.8.1 | | |
| v4.8.0 | | |
| v4.7.5 | | |
| v4.7.4 | | |
| v4.7.3 | | |
| v4.7.2 | | |
| v4.7.1 | | |
| v4.7.0 | | |
| v4.6.0 | | |
| v4.5.4 | | |
| v4.5.3 | | |
| v4.5.2 | | |
| v4.5.1 | | |
| v4.5.0 | | |
| v4.4.5 | | |
| v4.4.4 | | |
| v4.4.3 | | |
| v4.4.2 | | |
| v4.4.1 | | |
| v4.4.0 | | |
| v4.3.11 | | |
| v4.3.10 | | |
| v4.3.9 | | |
| v4.3.8 | | |
| v4.3.7 | | |
| v4.3.6 | | |
| v4.3.5 | | |
| v4.3.4 | | |
| v4.3.3 | | |
| v4.3.2 | | |
| v4.3.1 | | |
| v4.3.0 | | |
| v4.2.7 | 1.13.2 | 7.11.2 | | v4.2.7 | 1.13.2 | 7.11.2 |
| v4.2.6 | 1.13.2 | 7.11.2 | | v4.2.6 | 1.13.2 | 7.11.2 |
| v4.2.5 | 1.13.2 | 7.11.2 | | v4.2.5 | 1.13.2 | 7.11.2 |

View File

@@ -12,7 +12,7 @@ STAGE=""
FILES_EDITED=() FILES_EDITED=()
get_old_version_and_stage() { get_old_version_and_stage() {
local VERSION_FILE="../VERSION.json" local VERSION_FILE="${DIR}/VERSION.json"
OLD_VERSION=$(jq -r '.version' "${VERSION_FILE}") OLD_VERSION=$(jq -r '.version' "${VERSION_FILE}")
OLD_STAGE=$(jq -r '.stage' "${VERSION_FILE}") OLD_STAGE=$(jq -r '.stage' "${VERSION_FILE}")
@@ -38,10 +38,9 @@ update_version_in_files() {
m_m_p_files=( $(grep_command "${OLD_MAYOR}\.${OLD_MINOR}\.${OLD_PATCH}" "${DIR}") ) m_m_p_files=( $(grep_command "${OLD_MAYOR}\.${OLD_MINOR}\.${OLD_PATCH}" "${DIR}") )
for file in "${m_m_p_files[@]}"; do for file in "${m_m_p_files[@]}"; do
if [[ "${file}" == *"CHANGELOG.md"* ]]; then if [[ "${file}" == *"CHANGELOG.md"* ]]; then
sed -i "/^All notable changes to this project will be documented in this file.$/a \\\n## [${VERSION}]\\n\\n### Added\\n\\n- None\\n\\n### Changed\\n\\n- None\\n\\n### Fixed\\n\\n- None\\n\\n### Deleted\\n\\n- None" "${file}" if ! sed -i "/^All notable changes to this project will be documented in this file.$/a \\\n## [${VERSION}]\\n\\n### Added\\n\\n- None\\n\\n### Changed\\n\\n- None\\n\\n### Fixed\\n\\n- None\\n\\n### Deleted\\n\\n- None" "${file}"; then
elif [[ "${file}" == *"README.md"* ]]; then echo "Error: Failed to update CHANGELOG.md" | tee -a "${LOG_FILE}"
sed -i "/^| v${OLD_VERSION} | | |/i | v${VERSION} | | |" "${file}" fi
sed -i "/^| v${OLD_VERSION} | | |/!s/${OLD_MAYOR}\.${OLD_MINOR}\.${OLD_PATCH}/${NEW_MAYOR}\.${NEW_MINOR}\.${NEW_PATCH}/g" "${file}"
else else
sed -i "s/${OLD_MAYOR}\.${OLD_MINOR}\.${OLD_PATCH}/${NEW_MAYOR}\.${NEW_MINOR}\.${NEW_PATCH}/g" "${file}" sed -i "s/${OLD_MAYOR}\.${OLD_MINOR}\.${OLD_PATCH}/${NEW_MAYOR}\.${NEW_MINOR}\.${NEW_PATCH}/g" "${file}"
fi fi
@@ -109,6 +108,19 @@ main() {
exit 1 exit 1
fi fi
# Validate if version is in the correct format
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: Version must be in the format X.Y.Z (e.g., 1.2.3)." | tee -a "${LOG_FILE}"
exit 1
fi
# Validate if stage is in the correct format
STAGE=$(echo "$STAGE" | tr '[:upper:]' '[:lower:]')
if ! [[ "$STAGE" =~ ^(alpha[0-9]*|beta[0-9]*|rc[0-9]*|stable)$ ]]; then
echo "Error: Stage must be one of the following examples: alpha1, beta1, rc1, stable." | tee -a "${LOG_FILE}"
exit 1
fi
# Get old version and stage # Get old version and stage
get_old_version_and_stage get_old_version_and_stage