-
Notifications
You must be signed in to change notification settings - Fork 640
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
Add /output props #534
Add /output props #534
Conversation
I'm on the failing test ... |
It might be good to instead have an argument which writes out the file (it should also support appending). I assume Jenkins captures build output, so I like to rule |
This is what I would use in a Windows batch command:
I like that gitversion allows us to use its output this way, no need for additional functionality in GitVersion IMO. @JakeGinnivan what do wou mean by
|
If I have a look at a GitVersion build log, I get
So the log messages go to the console. I then use the environmental variables later in the build. I find the gitversion logs handy, which is why it might be good to allow the output to be directed to a file and the log to go to the console? |
Ah, I see what you're at. How is logging configured for GitVersion? Is it a --verbose switch? If I do |
E.g. in a power shell prompt I do |
@JakeGinnivan thanks for the link. I do not fundamentally object writing this to a file directly (and it would also meet my personal needs for better Jenkins integration), but I still feel writing it to the console (both json and props) is more flexible, allows for good integration with other tools (I really don't understand anobleperson's problems mentioned in #404) and has really small code-footprint. But if you guys feel like writing to a file is better let me know and I'll be happy to implement. |
If a build fails due to gitversion, how does the user see the logs? Or if gitversion calculates the version wrong? Unless you setup the gitversion logs to a file which is automatically picked up as an artifact not sure what we can do? The issue is that you cannot log the result and also the log to the build output at the same time, I think we dump the log to the console when it fails but not sure that is enough/ideal. This is the idea of plugins/service messages. We can log and give the build server the result. Currently there are two command line variables which control this, |
OK, but doesn't that mean that I'll let this sink in for a moment and come up with a proposal. I understand your thoughts a lot better now, thanks. |
Of course, I might be the only using gitversion this way ... one must never rule that out 😄 |
Note to self: the console output is used for several purposes :
So in some cases we might get additional text written to the console, making it unreliable to use gitversion stdout for further processing:
So:
|
This is one of the things I would like to try to figure out and fix in #428 for v4.. |
OK. Although this was an interesting exercise, this is not the way to go. I assumed that using the output to stdout for further processing was the way to go, but this discussion revealed to me that this is a questionable assumption. I can meet my need by implementing this in a |
👍 awesome, thanks a lot |
This allows for easy integration with Jenkins CI server.
Any feedback is welcome.
I think I understood how to write most tests, but I did not know how to test the actual output of gitversion.exe.
Hope this helps!