The script provides automation for handling project versioning, tagging, and Git operations across multiple project types (Maven, Angular, Ant). Below are the main publicly available functions that can be called directly or used via CLI:
Updates the version numbers of all projects (or a filtered project) according to the configuration in release_handler_config.yaml.
- 💡 Supports Maven (
pom.xml), Angular (package.json), and Ant (version.properties) projects. - ⚙️ Clones the project repository and updates properties and dependencies.
- 📝 Prompts to commit the version changes.
Creates Git tags for projects based on configurations.
- 🏷️ Tags the project with a specified value, optionally appending a progressive suffix.
- 🧪 Checks if the tag exists and pushes it to the remote if it does not.
Pushes committed changes to the remote repository after optional compilation checks.
- ✅ Detects unpushed commits.
- 🔍 Offers to compile the project before pushing (based on project type).
- ⬆️ Pushes changes to the remote only if confirmed.
Extracts Git information from all configured repositories and exports it into a formatted Excel file.
- 📊 Includes remote URL, last commit info, tags, and branches.
- 🖨️ Automatically adjusts column widths and applies header formatting.
You can invoke this script from the command line with:
python release_handler.py <command> [project_name]update_versions– Updates version numbers.update_tags– Tags the repository.push_changes– Pushes committed changes.extract_git_info_to_excel– Exports Git metadata to Excel.
python release_handler.py update_versions my-projectMake sure Python 3.7 or higher is installed on your system.
sudo apt update
sudo apt install python3 python3-pipbrew install python- Download the installer from the official Python website.
- During installation, make sure to check the box "Add Python to PATH".
This script requires several Python packages which can be installed using pip. Run the following command in your terminal:
pip install -r requirements.txtpyyaml
click
lxml
pandas
openpyxl
Alternatively, you can install them directly:
pip install pyyaml click lxml pandas openpyxlYou can verify the installation by running:
python release_handler.py --helpIf the script runs without import errors, you're all set!