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

GitVersion /output buildserver does not create gitversion.properties file #1227

Closed
dermeister0 opened this issue May 26, 2017 · 4 comments

Comments

@dermeister0
Copy link

commented May 26, 2017

GitVersion 3.6.4.0

PS C:\Work\GitVersion> GitVersion                                                                    
{                                                                                                        
  "Major":4,                                                                                             
  "Minor":0,                                                                                             
  "Patch":0,                                                                                             
  "PreReleaseTag":"beta.13",                                                                             
  "PreReleaseTagWithDash":"-beta.13",                                                                    
  "PreReleaseLabel":"beta",                                                                              
  "PreReleaseNumber":13,                                                                                 
  "BuildMetaData":1322,                                                                                  
  "BuildMetaDataPadded":1322,                                                                            
  "FullBuildMetaData":"1322.Branch.master.Sha.891eabaa0c2d0fe7a2dd139755ab21b725a03bc5",                 
  "MajorMinorPatch":"4.0.0",                                                                             
  "SemVer":"4.0.0-beta.13",                                                                              
  "LegacySemVer":"4.0.0-beta13",                                                                         
  "LegacySemVerPadded":"4.0.0-beta0013",                                                                 
  "AssemblySemVer":"4.0.0.0",                                                                            
  "FullSemVer":"4.0.0-beta.13+1322",                                                                     
  "InformationalVersion":"4.0.0-beta.13+1322.Branch.master.Sha.891eabaa0c2d0fe7a2dd139755ab21b725a03bc5",
  "BranchName":"master",                                                                                 
  "Sha":"891eabaa0c2d0fe7a2dd139755ab21b725a03bc5",                                                      
  "NuGetVersionV2":"4.0.0-beta0013",                                                                     
  "NuGetVersion":"4.0.0-beta0013",                                                                       
  "CommitsSinceVersionSource":1322,                                                                      
  "CommitsSinceVersionSourcePadded":1322,                                                                
  "CommitDate":"2017-05-21"                                                                              
}                                                                                                        
PS C:\Work\GitVersion> GitVersion /output buildserver
INFO [05/26/17 17:34:14:75] Working directory: C:\Work\GitVersion
INFO [05/26/17 17:34:14:76] IsDynamicGitRepository: False
INFO [05/26/17 17:34:14:77] Returning Project Root from DotGitDirectory: C:\Work\GitVersion\.git - C:\Work\GitVersion
INFO [05/26/17 17:34:14:78] Running on Windows.
INFO [05/26/17 17:34:14:78] IsDynamicGitRepository: False
INFO [05/26/17 17:34:14:78] Returning Project Root from DotGitDirectory: C:\Work\GitVersion\.git - C:\Work\GitVersion
INFO [05/26/17 17:34:14:78] Project root is: C:\Work\GitVersion
INFO [05/26/17 17:34:14:78] DotGit directory is: C:\Work\GitVersion\.git
INFO [05/26/17 17:34:14:79] IsDynamicGitRepository: False
INFO [05/26/17 17:34:14:79] Returning Project Root from DotGitDirectory: C:\Work\GitVersion\.git - C:\Work\GitVersion
INFO [05/26/17 17:34:14:84] Begin: Loading version variables from disk cache
  INFO [05/26/17 17:34:14:84] Begin: Deserializing version variables from cache file C:\Work\GitVersion\.git\gitversion_cache\12CEF13D9B0DD643AC62CD0127F16971EA3D1E88.yml
  INFO [05/26/17 17:34:14:91] End: Deserializing version variables from cache file C:\Work\GitVersion\.git\gitversion_cache\12CEF13D9B0DD643AC62CD0127F16971EA3D1E88.yml (Took: 66.00ms)
INFO [05/26/17 17:34:14:91] End: Loading version variables from disk cache (Took: 67.00ms)
PS C:\Work\GitVersion> Get-Item gitversion.properties
Get-Item : Cannot find path 'C:\Work\GitVersion\gitversion.properties' because it does not exist.
At line:1 char:1
+ Get-Item gitversion.properties
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Work\GitVersion\gitversion.properties:String) [Get-Item], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand
@asbjornu

This comment has been minimized.

Copy link
Member

commented May 27, 2017

The /output buildserver command is not supposed to output a file. Please read the documentation, which states:

When GitVersion.exe is run with the /output buildserver flag instead of outputting Json it will export variables to the current build server. For instance if you are running in TeamCity after you run GitVersion /output buildserver you will have the %system.GitVersion.SemVer% available for you to use

What build server are you using and why do you expect a gitversion.properties file to be produced?

@dermeister0

This comment has been minimized.

Copy link
Author

commented May 28, 2017

I have Jenkins. It was not clear for me that GitVersion tries to detect my build server.

The following example works:

$env:JENKINS_URL = 'http://localhost:8080'
GitVersion /output buildserver

If JENKINS_URL or GITLAB_CI environment variable presents, gitversion.properties file is created.

@asbjornu

This comment has been minimized.

Copy link
Member

commented May 29, 2017

I see. Can this issue be closed, then?

@dermeister0

This comment has been minimized.

Copy link
Author

commented May 30, 2017

Yes, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.