Skip to content

Support for generic build servers, improved scripting support #1451

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

Merged
merged 7 commits into from
Feb 15, 2019
Merged

Support for generic build servers, improved scripting support #1451

merged 7 commits into from
Feb 15, 2019

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! 🙏

@arturcic arturcic added this to the 5.0.0 milestone Feb 15, 2019
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