GitVersion icon indicating copy to clipboard operation
GitVersion copied to clipboard

[Feature Request] additional commandline option to set environment variables and modify default output

Open ericnewton76 opened this issue 3 years ago • 2 comments

Having gitversion set environment variables GITVERSION_[NAME]=value be helpful. gitversion /setenvironmentvariables

Also, would be nice to modify the format of the output. Instead of JSON, using a flatter NAME=value would be helpful. gitversion /output:flat

With flat output, or even json output (although dont know why you'd need it for json), specifying specific variables to output would also be helpful: gitversion /output:flat /variables:FullSemVer and gitversion /output:flat /variables=FullSemVer,MajorMinorPatch

Just spitballing here. Currently having to write a cmd for to parse the json output for FullSemVer and its not pleasant... ;-)

ericnewton76 avatar Sep 01 '22 17:09 ericnewton76

Having gitversion set environment variables GITVERSION_[NAME]=value be helpful. gitversion /setenvironmentvariables

Adding a switch for it doesn't make much sense since GitVersion already does this automatically on build servers. Are you thinking this should be done on local builds as well? If so, the LocalBuild agent could be made to do it.

Also, would be nice to modify the format of the output. Instead of JSON, using a flatter NAME=value would be helpful. gitversion /output:flat

Sounds like something we can plan for with a new CLI in version 7. See #2275.

With flat output, or even json output (although dont know why you'd need it for json), specifying specific variables to output would also be helpful: gitversion /output:flat /variables:FullSemVer and gitversion /output:flat /variables=FullSemVer,MajorMinorPatch

I don't think we're going to cram this into the already overloaded and at the brink of collapse CLI we have, but please read #2275 and make suggestions given the proposed command-based CLI syntax there. 👍🏼

Just spitballing here. Currently having to write a cmd for to parse the json output for FullSemVer and its not pleasant... ;-)

I agree!

asbjornu avatar Sep 02 '22 09:09 asbjornu

The new CLI looks like a step in the right direction. I see other issues with ordering of options here, and the new verb-based CLI should make that easier to deal with

ericnewton76 avatar Sep 12 '22 16:09 ericnewton76

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.

github-actions[bot] avatar Mar 04 '23 09:03 github-actions[bot]

We added support in v6-beta1 this https://github.com/GitTools/GitVersion/issues/3400, I guess this can solve your issue.

arturcic avatar Mar 04 '23 09:03 arturcic