Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ericnewton76 opened this issue Sep 1, 2022 · 4 comments

Comments

@ericnewton76
Copy link

ericnewton76 commented Sep 1, 2022

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 ericnewton76 changed the title [Feature Request] additional commandline option to set environment variables [Feature Request] additional commandline option to set environment variables and modify default output Sep 1, 2022
@asbjornu
Copy link
Member

asbjornu commented Sep 2, 2022

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!

@ericnewton76
Copy link
Author

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

@github-actions
Copy link

github-actions bot commented Mar 4, 2023

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 github-actions bot added the stale label Mar 4, 2023
@arturcic
Copy link
Member

arturcic commented Mar 4, 2023

We added support in v6-beta1 this #3400, I guess this can solve your issue.

@arturcic arturcic closed this as completed Mar 4, 2023
@arturcic arturcic removed the stale label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants