Skip to content

Using /output buildserver does not work when /nocache declared first #1928

@roryprimrose

Description

@roryprimrose

If you run /output buildserver /nocache then the output is buildserver as expected. However if you run /nocache /output buildserver, the output is json.

The same does not apply to /nofetch where the /output is honored whether /nofetch is declared before or after /output.

For example, I am running the following docker command

docker run -it --rm --entrypoint "/bin/bash" -v ${PWD}:/github/workspace gittools/gitversion:5.1.3-linux-ubuntu-18.04-netcoreapp2.1

I get the following if I run /output buildserver /nocache

root@e931f25d3f7b:/app# dotnet GitVersion.dll /github/workspace /output buildserver /nocache
INFO [11/21/19 11:36:18:81] Working directory: /github/workspace
INFO [11/21/19 11:36:18:81] IsDynamicGitRepository: False
INFO [11/21/19 11:36:18:84] Returning Project Root from DotGitDirectory: /github/workspace/.git/ - /github/workspace/
INFO [11/21/19 11:36:18:85] Running on Unix.
INFO [11/21/19 11:36:18:85] Project root is: /github/workspace/
INFO [11/21/19 11:36:18:85] DotGit directory is: /github/workspace/.git
INFO [11/21/19 11:36:19:06] Using latest commit on specified branch
INFO [11/21/19 11:36:19:13] Running against branch: master (c28cecc4fc5ab8eadafafa68d0259b1286584f99)
INFO [11/21/19 11:36:19:13] Begin: Calculating base versions
  INFO [11/21/19 11:36:19:16] Fallback base version: 0.1.0 with commit count source 64705abfad54d484e6c252c01a698e94b8da8924 (Incremented: None)
  INFO [11/21/19 11:36:19:24] Git tag 'v1.0.0': 1.0.0 with commit count source 80f02b02c55975abac3836750542fe3d596c2cf4 (Incremented: 1.0.1)
  INFO [11/21/19 11:36:19:27] Found multiple base versions which will produce the same SemVer (1.0.1), taking oldest source for commit counting (Git tag 'v1.0.0')
  INFO [11/21/19 11:36:19:27] Base version used: Git tag 'v1.0.0': 1.0.0 with commit count source 80f02b02c55975abac3836750542fe3d596c2cf4 (Incremented: 1.0.1)
  INFO [11/21/19 11:36:19:27] End: Calculating base versions (Took: 142.11ms)
  INFO [11/21/19 11:36:19:28] 1 commits found between 80f02b02c55975abac3836750542fe3d596c2cf4 and c28cecc4fc5ab8eadafafa68d0259b1286584f99
  INFO [11/21/19 11:36:19:29] Begin: Getting version tags from branch 'refs/heads/master'.
  INFO [11/21/19 11:36:19:31] End: Getting version tags from branch 'refs/heads/master'. (Took: 19.78ms)

However if I run with /nocache /output buildserver I get the following

root@e931f25d3f7b:/app# dotnet GitVersion.dll /github/workspace /nocache /output buildserver
{
  "Major":1,
  "Minor":0,
  "Patch":1,
  "PreReleaseTag":"beta.1",
  "PreReleaseTagWithDash":"-beta.1",
  "PreReleaseLabel":"beta",
  "PreReleaseNumber":1,
  "WeightedPreReleaseNumber":55001,
  "BuildMetaData":"",
  "BuildMetaDataPadded":"",
  "FullBuildMetaData":"Branch.master.Sha.c28cecc4fc5ab8eadafafa68d0259b1286584f99",
  "MajorMinorPatch":"1.0.1",
  "SemVer":"1.0.1-beta.1",
  "LegacySemVer":"1.0.1-beta1",
  "LegacySemVerPadded":"1.0.1-beta0001",
  "AssemblySemVer":"1.0.1.0",
  "AssemblySemFileVer":"1.0.1.0",
  "FullSemVer":"1.0.1-beta.1",
  "InformationalVersion":"1.0.1-beta.1+Branch.master.Sha.c28cecc4fc5ab8eadafafa68d0259b1286584f99",
  "BranchName":"master",
  "Sha":"c28cecc4fc5ab8eadafafa68d0259b1286584f99",
  "ShortSha":"c28cecc",
  "NuGetVersionV2":"1.0.1-beta0001",
  "NuGetVersion":"1.0.1-beta0001",
  "NuGetPreReleaseTagV2":"beta0001",
  "NuGetPreReleaseTag":"beta0001",
  "VersionSourceSha":"80f02b02c55975abac3836750542fe3d596c2cf4",
  "CommitsSinceVersionSource":1,
  "CommitsSinceVersionSourcePadded":"0001",
  "CommitDate":"2019-11-21"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions