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

During build process env variables about version not available later in build process #1874

Closed
StanleyGoldman opened this issue Sep 26, 2018 · 2 comments
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR

Comments

@StanleyGoldman
Copy link
Contributor

While developing #1866

This part of the build process gives the impression that certain environment variables set by GitVersion should be available later in the build process.

if (!context.IsLocalBuild)
{
// Run to set the version properties inside the CI server
GitVersionRunner.Run(context, GitVersionOutput.BuildServer);
}
// Run in interactive mode to get the properties for the rest of the script
var assertedversions = GitVersionRunner.Run(context, GitVersionOutput.Json);

I had to work around this to convey the values I needed, but a permanent fix would be to store the returned version with the build context.

Other notes

https://ci.appveyor.com/project/github-windows/octokit-net/build/0.33.0-PullRequest.1866+37.build.2897

Executing GenerateSetVersionMessage for 'AppVeyor'.
Set AppVeyor build number to '0.33.0-PullRequest.1866+37'.
Executing GenerateBuildLogOutput for 'AppVeyor'.
Adding Environment Variable. name='GitVersion_Major' value='0']
Adding Environment Variable. name='GitVersion_Minor' value='33']
Adding Environment Variable. name='GitVersion_Patch' value='0']
Adding Environment Variable. name='GitVersion_PreReleaseTag' value='PullRequest.1866']
Adding Environment Variable. name='GitVersion_PreReleaseTagWithDash' value='-PullRequest.1866']
Adding Environment Variable. name='GitVersion_PreReleaseLabel' value='PullRequest']
Adding Environment Variable. name='GitVersion_PreReleaseNumber' value='1866']
Adding Environment Variable. name='GitVersion_BuildMetaData' value='37']
Adding Environment Variable. name='GitVersion_BuildMetaDataPadded' value='0037']
Adding Environment Variable. name='GitVersion_FullBuildMetaData' value='37.Branch.pull/1866/merge.Sha.20d6a20f355896272d9a142f414d263267c7d018']
Adding Environment Variable. name='GitVersion_MajorMinorPatch' value='0.33.0']
Adding Environment Variable. name='GitVersion_SemVer' value='0.33.0-PullRequest.1866']
Adding Environment Variable. name='GitVersion_LegacySemVer' value='0.33.0-PullRequest1866']
Adding Environment Variable. name='GitVersion_LegacySemVerPadded' value='0.33.0-PullRequest1866']
Adding Environment Variable. name='GitVersion_AssemblySemVer' value='0.33.0.0']
Adding Environment Variable. name='GitVersion_FullSemVer' value='0.33.0-PullRequest.1866+37']
Adding Environment Variable. name='GitVersion_InformationalVersion' value='0.33.0-PullRequest.1866+37.Branch.pull/1866/merge.Sha.20d6a20f355896272d9a142f414d263267c7d018']
Adding Environment Variable. name='GitVersion_BranchName' value='pull/1866/merge']
Adding Environment Variable. name='GitVersion_Sha' value='20d6a20f355896272d9a142f414d263267c7d018']
Adding Environment Variable. name='GitVersion_NuGetVersionV2' value='0.33.0-pullrequest1866']
Adding Environment Variable. name='GitVersion_NuGetVersion' value='0.33.0-pullrequest1866']
Adding Environment Variable. name='GitVersion_CommitsSinceVersionSource' value='37']
Adding Environment Variable. name='GitVersion_CommitsSinceVersionSourcePadded' value='0037']
Adding Environment Variable. name='GitVersion_CommitDate' value='2018-09-25']
@shiftkey
Copy link
Member

I had to work around this to convey the values I needed, but a permanent fix would be to store the returned version with the build context.

I'm not sure what values are needed here, and things seem to be working fine for now.

If something comes up we can revisit this.

@nickfloyd nickfloyd added Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR Status: Up for grabs Issues that are ready to be worked on by anyone and removed category: housekeeping labels Oct 27, 2022
@SlyckLizzie
Copy link
Contributor

I want to revisit this. More specifically my question is "How can I pass a specific version to the build script while testing locally?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR
Projects
None yet
Development

No branches or pull requests

4 participants