Skip to content

Commit

Permalink
Merge pull request #3077 from wazuh/change/3075-bump-4.8.2
Browse files Browse the repository at this point in the history
Fix 4.8.2 version bump
  • Loading branch information
vikman90 authored Aug 19, 2024
2 parents 7985092 + e515920 commit 0ca74c3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion bump_version.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#! /usr/bin/env python3

"""
This script is used to bump the version of the Wazuh packages repository.
Copyright (C) 2015-2020, Wazuh Inc.
Expand Down Expand Up @@ -29,14 +31,15 @@
version=Version(args.version)

## Find files to bump .spec, changelog, pkginfo, .pkgproj, test-*.sh,
## installVariables.sh, CHANGELOG.md
## installVariables.sh, unattended_installer/builder.sh, CHANGELOG.md
spec_files=glob.glob('**/*.spec', recursive=True)
changelog_files=glob.glob('**/changelog', recursive=True)
copyright_files=glob.glob('**/copyright', recursive=True)
pkginfo_files=glob.glob('**/pkginfo', recursive=True)
pkgproj_files=glob.glob('**/*.pkgproj', recursive=True)
test_files=glob.glob('**/test-*.sh', recursive=True)
install_variables_files=glob.glob('**/installVariables.sh', recursive=True)
unattended_builder_files=glob.glob('**/unattended_installer/builder.sh', recursive=True)
changelog_md_files=glob.glob('**/CHANGELOG.md', recursive=True)
VERSION_files=glob.glob('**/VERSION', recursive=True)

Expand Down Expand Up @@ -171,6 +174,19 @@
with open(install_variables_file, 'w', encoding="utf-8") as file:
file.write(filedata)

## Bump version in unattended installer build file

for builder_file in unattended_builder_files:
with open(builder_file, 'r', encoding="utf-8") as file:
print('Bumping version in ' + builder_file)
filedata=file.read()
# Replace version and revision
REGEX=r'source_branch="(\d+\.\d+\.\d+)"'
filedata=re.sub(REGEX, f'source_branch="{version}"', filedata)

with open(builder_file, 'w', encoding="utf-8") as file:
file.write(filedata)

## Bump version in CHANGELOG.md files

for changelog_md_file in changelog_md_files:
Expand Down
Empty file removed hello
Empty file.
2 changes: 1 addition & 1 deletion unattended_installer/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ readonly resources_certs="${base_path_builder}/cert_tool"
readonly resources_passwords="${base_path_builder}/passwords_tool"
readonly resources_common="${base_path_builder}/common_functions"
readonly resources_download="${base_path_builder}/downloader"
source_branch="4.8.1"
source_branch="4.8.2"

function getHelp() {

Expand Down

0 comments on commit 0ca74c3

Please sign in to comment.