-
Notifications
You must be signed in to change notification settings - Fork 125
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
Added gitversion4 (beta) support as well as MR which sets TeamCity build counter as build number #132
base: master
Are you sure you want to change the base?
Conversation
…e latest 4.0 beta built (this probably will need to be changed in the future).
…ons json output and manually echo ##teamcity[setparameter messages back to stdout. This allows this runner to disable the built-in and not-configurable setting of build.number by GitVersion. The MR then outputs ##teamcity[buildnumer '<SemVer>+build%build.counter%'] to stdout which will set the build number in Teamcity to the SemVer + buildNN where nn is the build counter kept by Teamcity
Just an update on this, I made this MR so that the build metadata is passed as |
$semVer variable was not correctly escaped
Since v4 is released we don't need to pass --pre anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one small change needed.
} | ||
|
||
Write-Host "##teamcity[progressMessage 'Running: $gitversion $safeArgs']" | ||
$gvOutput = Invoke-Expression "gitversion $arguments" | Out-String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gitversion
here should be $gitversion
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, thanks for noticing!
I've corrected it with another commit.
Previously gitversion was invoked reliant on it being in the PATH. This is now changed to the path constructed by the previous part of this script.
The existing MR for GitVersion will set the
FullSemVer
variable as build number in Teamcity, this variable is purely based on the repository and does not take into account the build counter kept by Teamcity.While in some situations (as described by @RobSmyth in GitTools/GitVersion#1367) this information is considered important or even critical.
At the moment Chocolately does not seem to offer a good way to say 'I want version 4.x, included beta- or pre-releases', so I've just had to pass the --pre parameter to the
choco install
call in these runners, this will result in the next beta release being installed (5.x?) as soon as GitVersion 4.0 is released in production.