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

"/output json" does not work in build server environment #1236

Closed
marc-mueller opened this issue Jun 14, 2017 · 11 comments · Fixed by #2128
Closed

"/output json" does not work in build server environment #1236

marc-mueller opened this issue Jun 14, 2017 · 11 comments · Fixed by #2128
Labels

Comments

@marc-mueller
Copy link

Hello

We would like to execute GitVersion from withing a build script, but would like to get the json output. If the build environment is detected, the option json is ignored.

This was already issued once: #675

Apparentely, this bug seems to be still open.

You can repro it by yourself by executing the following inside a PowerShell session:

$env:TF_BUILD = "True"
GitVersion.exe /output json /nofetch

The output is still the "buildserver" one.

@asbjornu
Copy link
Member

@marc-mueller: Can you please tell me whether #983 would offer the same functionality you're asking for?

@marc-mueller
Copy link
Author

Not really. The output in a file would be handy, but the main problem still exists. Then GitVersion detects the build server (in our case VSTS / TFS) it automatically changes the build number. We cannot allow this since another task handles the build number.

Our current solution ist to start GitVersion in a new process where we override the environment variable "TF_BUILD" with a blank value so we get the json input. We then just parse the JSON output.

Having this output in a file instead on the standard output, does not matter since it is +/- the same effort to parse it.

@stale
Copy link

stale bot commented Jun 29, 2019

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. Thank you for your contributions.

@stale stale bot added the stale label Jun 29, 2019
@stale stale bot closed this as completed Jul 29, 2019
@dbak-invn
Copy link

I am still having this problem on Jenkins. Any chance this will be fixed?

@tmeckel
Copy link

tmeckel commented Mar 5, 2020

Same issue here with the Gitlab CI/CD pipeline. The GitVersion.exe tool doesn't honor the /output json flag. This definitely has to be fixed!

image

image

Related: #675

@arturcic
Copy link
Member

arturcic commented Mar 5, 2020

@tmeckel this one was implemented starting with version 5.1.4-beta1-192, can you try this version?

@tmeckel
Copy link

tmeckel commented Mar 5, 2020

@arturcic First: I can try this version out next Tuesday earliest. Secondly: do I've to compile this version by myself? I couldn't find a pre-release version with that SemVer in the releases and no Git tag of that name.

@arturcic
Copy link
Member

arturcic commented Mar 5, 2020

you can find it here https://www.nuget.org/packages/GitVersionTask/5.1.4-beta1.229, but if you can wait, we'll soon have a 5.2.0 stable release

@tmeckel
Copy link

tmeckel commented Mar 5, 2020

As I can see the NuGet Package includes the MsBuild task. We're not utilizing the MsBuild Task but the executable GitVersion.exe. Does the mentioned NuGet package include the executable as well? And what's the time frame until Release 5.2.0 is available?

@arturcic
Copy link
Member

arturcic commented Mar 5, 2020

wrong package, use this one https://www.nuget.org/packages/GitVersion.CommandLine/5.1.4-beta1.229, this one has the exe

@tmeckel
Copy link

tmeckel commented Mar 5, 2020

I'll give this a try next week. I'll keep you updated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants