question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add ability to run arbitrary hooks pre/post version bump

See original GitHub issue

Description

To use the currently available hook facilities, it is necessary to create a custom cz_ adapter class to use hooks during the version bump / changelog generation. I’d like to be able to run arbitrary hooks (i.e. a shell script or other external executable) from a simple configuration file section. In my specific use-case I’d like for the hooks to be run after the changelog generation and before the version bump in case of cz bump --changelog (see also #290), but I can imaging the following hook locations to be useful:

  1. before changelog
  2. after changelog and before commit and tag
  3. after tag

Possible Solution

Implement hook facilities at the aforementioned locations. They should be configurable via the configuration file for example as follows, allowing for multiple commands to be run at a given location

[[tool.commitizen.hook_begin]]
command = "./update-something.sh"

[[tool.commitizen.hook_begin]]
command = "./do-another-thing.sh"

[[tool.commitizen.hook_before_commit]]
command = "./build-something-based-on-changelog.sh"

[tool.commitizen.hook_end]
command = "./push-artifacts.py"

Given commands should run with useful execution context, such as current and future version as arguments and/or environment variables.


I’d be happy to implement this as well. Cheers.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
janwcommented, Nov 13, 2020

Awesome, I’ll make it presentable early next week and get back to you! 💪

1reaction
woilecommented, Nov 11, 2020

Hey @janw I’m interested. I’d like to see it. Regards!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Version 1.3 - Nautobot Documentation
Nautobot v1.3¶. This document describes all new features and changes in Nautobot 1.3. If you are a user migrating from NetBox to Nautobot,...
Read more >
Release Notes - Apache Airflow documentation - Amazon AWS
Ability to clear a specific DAG Run's task instances via REST API (#23516) ... Add pre/post execution hooks [Experimental] (#17576).
Read more >
Ammonite
The goal of Ammonite is to liberate your Scala code from heavyweight "projects", using the lightweight Ammonite runtime: if you want to run...
Read more >
Untitled
Fix gconf hooks. - Require system-logos instead. - Bump version to work around tagging weirdness. - Add devel package and require redhat-logos instead...
Read more >
Untitled
Bump release number. (dist-fc6-java) - Rebuilt - Add x86_64 to the build - Merge with upstream - Do not use jython as it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found