Input variables
#4503
Replies: 1 comment 2 replies
-
@asbjornu what should be the content of the state file? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Regarding #4456, it seems like we have an increasing need in the community to affect the input to GitVersion in order to control how it generates its output.
As we already have a set of standardized "output variables", perhaps we should establish a new concept around "input variables" as well?
These input variables could either be defined as environment variables, or as JSON, just like the output variables currently work. We already have
Git_Branch
which we need to keep for backwards compatibility, but I think we should namespace the environment variables withGitVersion_*
just like we do for the output variables.Specific use-cases for input variables would be build agents and CI/CD pipelines (see #4212), but eventually I hope that GitVersion can be executed on a static JSON input file (piped from another GitVersion command, as discussed in #2275) and that the static JSON contains absolutely everything required for GitVersion to calculate a version number, regardless of how it's configured. Sort of like:
gitversion prepare
→ Prepares and validates the JSON input document we are discussing now. This step is optional and can be replaced with a static and guaranteed valid JSON input document.gitversion execute
→ Reads the JSON input document, the configuration file, and produces a JSON file representing the current state of the repository.gitversion calculate
→ Reads the JSON state file from step 2 and performs the version calculation. The result is a JSON output document.I'm not set on the naming or details, but I hope the above is sufficient to understand the general idea and to foster further discussions.
Beta Was this translation helpful? Give feedback.
All reactions