Git版本总是将prerelase标签设置为" unstable" - 如何使其尊重配置文件?

时间:2016-02-10 04:04:08

标签: git git-flow gitversion

我不能为我的生活找出如何将PreReleaseLabel更改为Alpha或GitVersionConfig.yaml中的任何内容。是否有一种方法可以让gitversion找出它的想法?

这是我的gitversion输出:

GitVersion.exe

{
  "Major":3,
  "Minor":10,
  "Patch":1,
  "PreReleaseTag":"unstable.1",
  "PreReleaseTagWithDash":"-unstable.1",
  "PreReleaseLabel":"unstable",
  "PreReleaseNumber":1,
  "BuildMetaData":"",
  "BuildMetaDataPadded":"",
  "FullBuildMetaData":"Branch.develop.Sha.93033f2b5a166cb44da9dff6d72697de68096499",
  "MajorMinorPatch":"3.10.1",
  "SemVer":"3.10.1-unstable.1",
  "LegacySemVer":"3.10.1-unstable1",
  "LegacySemVerPadded":"3.10.1-unstable0001",
  "AssemblySemVer":"3.10.1.0",
  "FullSemVer":"3.10.1-unstable.1",
  "InformationalVersion":"3.10.1-unstable.1+Branch.develop.Sha.93033f2b5a166cb44da9dff6d72697de68096499",
  "BranchName":"develop",
  "Sha":"93033f2b5a166cb44da9dff6d72697de68096499",
  "NuGetVersionV2":"3.10.1-unstable0001",
  "NuGetVersion":"3.10.1-unstable0001",
  "CommitsSinceVersionSource":1,
  "CommitsSinceVersionSourcePadded":"0001",
  "CommitDate":"2016-02-10"
}

GitVersion.exe / output buildserver

INFO [02/10/16 17:00:35:73] Working directory: C:\BuildAgents\Agent-XXX\_work\1\s
INFO [02/10/16 17:00:35:78] Project root is: C:\BuildAgents\Agent-XXX\_work\1\s
INFO [02/10/16 17:00:35:93] Using latest commit on specified branch
INFO [02/10/16 17:00:35:96] Running against branch: develop (93033f2b5a166cb44da9dff6d72697de68096499)
INFO [02/10/16 17:00:35:98] Begin: Calculating base versions
  INFO [02/10/16 17:00:36:14] Fallback base version: 0.1.0 with commit count source 5c313e354c091a41573564037215c3cfc5e43b80
  INFO [02/10/16 17:00:36:29] NextVersion in GitVersionConfig.yaml: 3.10.0 with commit count source External Source
  INFO [02/10/16 17:00:36:53] Git tag 'v3.10.0': 3.10.0 with commit count source cedfccd47c77bca9ea4ccd43aa7492afc169a493
  INFO [02/10/16 17:00:36:59] Git tag 'v3.10.0': 3.10.0 with commit count source cedfccd47c77bca9ea4ccd43aa7492afc169a493
  INFO [02/10/16 17:00:36:84] Found multiple base versions which will produce the same SemVer (3.10.1), taking oldest source for commit counting (Git tag 'v3.10.0')
  INFO [02/10/16 17:00:36:84] Base version used: Git tag 'v3.10.0': 3.10.0 with commit count source cedfccd47c77bca9ea4ccd43aa7492afc169a493
INFO [02/10/16 17:00:36:84] End: Calculating base versions (Took: 859.31ms)
INFO [02/10/16 17:00:36:96] 1 commits found between cedfccd47c77bca9ea4ccd43aa7492afc169a493 and 93033f2b5a166cb44da9dff6d72697de68096499

这是我的GitVersionConfig.yaml文件

next-version: 3.10.0
mode: ContinuousDeployment

continuous-delivery-fallback-tag: Alpha
branches: 
  develop:
    mode: ContinuousDeployment
    tag: 
    increment: Patch
    prevent-increment-of-merged-branch-version: true
    track-merge-target: false

  features?[/-]:
    mode: ContinuousDeployment
    tag: useBranchName
    increment: Minor
    prevent-increment-of-merged-branch-version: false
    track-merge-target: false

1 个答案:

答案 0 :(得分:3)

next-version: 3.10.0
mode: ContinuousDeployment

branches: 
  develop:
    mode: ContinuousDeployment
    tag: Alpha
    increment: Patch
    prevent-increment-of-merged-branch-version: true
    track-merge-target: false

  features?[/-]:
    mode: ContinuousDeployment
    tag: useBranchName
    increment: Minor
    prevent-increment-of-merged-branch-version: false
    track-merge-target: false

这应该可以正常工作。开发中的空标签将默认恢复为不稳定。如果要清除标记,则需要使用空引号。我认为增强日志记录配置是一个好主意。