Add stage parameter in bump_version script #3121
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Due to the new change made in #3098, it was necessary to modify the
bump_version.py
script. A new stage parameter (-s) has been added, where, when used, the given stage will be appended to bothsource_branch
variables in theunattended_installer/install_functions/installVariables.sh
andunattended_installer/builder.sh
files.The purpose of this is that every time a support new stage is created and a tag is generated, these variables will retain the version value along with the stage (e.g.,
source_branch=v4.9.1-rc1
).Once the tag with the correct value is created, these variables should retain the value without the stage in the branch, only with the version (e.g.,
source_branch=v4.9.1
).Note
If the
-s
option is not used, no stage will be added, and if there was one previously, it will be removed.To achieve this, the script will need to be run twice: once with the
-s
option to add the stage, and then again without the-s
option to remove the stage after the tag is created.Each time the file was executed, both the
CHANGELOG
andaix/SPECS/wazuh-agent-aix.spec
files would add an entry mentioning the current version. To fix this and allow the script to be called multiple times without creating duplicate entries, two functions have been created to validate that an entry with the current version doesn't already exist.Tests
Below is the process for adding a stage to the source_branch variables, as well as its removal, which simply involves running the script again without the -s option.