Skip to content

Conversation

@ravenpride
Copy link
Contributor

@ravenpride ravenpride commented Aug 7, 2018

Dear development team,

my team is just setting up a GoCD build server and we found GitVersion really useful to keep versioning as easy and consistent as possible. Although many build servers are already supported by GitVersion, GoCD is not in the list. The main reason seems to be that GoCD does not support injecting retrieved version information into the build process.

To circumvent this missing feature in GoCD and probably other builder servers we've developed a small .NET tool called 'EnvRun'. It simply wraps processes and scans their output (stdout/stderr) for key expressions that control setting and resetting environment variables for following runs:

@@envrun[set name='MyVar' value='MyValue']
@@envrun[reset name='MyVar']

This pull request contains a new build server implementation for GitVersion that emits the messages EnvRun needs to operate. A short example on how to use EnvRun:

EnvRun.exe gitversion /l console /output buildserver
EnvRun.exe cmd.exe /C "echo %%GitVersion_MajorMinorPatch%%"

Please see the EnvRun project site for details.

@ravenpride
Copy link
Contributor Author

I'd like to see this tiny piece of code in the GitVersion codebase, so we can take advantage of it in newer releases of GitVersion. EnvRun does not only enable using GitVersion in GoCD, it can improve the use of GitVersion in scripts in general as it helps to access GitVersion data via environment variables.

Is there anything I can do to convince you to accept it ? :-)

@ravenpride
Copy link
Contributor Author

ravenpride commented Jan 23, 2019

Could someone from the GitVersion team please give a short statement on this pull request? Any idea/improvement that is needed to convince you to merge it into the GitVersion codebase? We actively use EnvRun and it works quite well when it comes to building using simple scripts or build servers that do not support injecting environment variables (like GoCD).

Thank you very much.

@asbjornu
Copy link
Member

@ravenpride, thanks for this. I see no problem in merging this besides the lack of tests. Can you please add a few tests for this new addition alongside the existing build server tests?

@ravenpride
Copy link
Contributor Author

@asbjornu Thank you for your clearance. I've added the unit tests, so everything should be ready to merge.

@asbjornu asbjornu merged commit 82c1b3c into GitTools:master Feb 15, 2019
@asbjornu
Copy link
Member

Thanks for your contributions! 🙏

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 this pull request may close these issues.

3 participants