azure - 在功能 gitflow 分支上使用 VS2017 中的 Gitversiontask,修订不增加
问题描述
我对所有AZURE devops 都很陌生。
我只是在我的 VS 解决方案上进行了最小安装,在我的解决方案中 nuget Gitversiontask,推送到 Azure Git 管道,它与开发分支一起工作。
我创建了 ( GitFLOW ) 一个名为 dostuff的功能。对类进行了一些更改,然后提交并推送...版本功能/我的应用程序 6.1.0-dostuff0001 出来了...Nuget 打包并推送...一切都很好。
然后做了另一个提交,管道开始但在Nuget 推送到工件...错误 409(冲突 - 提要已经包含'my-app 6.1.0-dostuff0001)。
- task: NuGetCommand@2
displayName: 'restore WinFormExtC.sln'
inputs:
restoreSolution: WinFormExtC/ActiveFramework.WinFormExtC.sln
feedsToUse: config
nugetConfigPath: NuGet/NuGet.Config
steps:
- task: VSBuild@1
displayName: 'Build solution WinFormExtC'
inputs:
solution: WinFormExtC/ActiveFramework.WinFormExtC.sln
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
steps:
- task: NuGetCommand@2
displayName: 'NuGet pack WinFormExtC'
inputs:
command: pack
packagesToPack: WinFormExtC/Package.nuspec
versioningScheme: byEnvVar
versionEnvVar: GitVersion.NuGetVersion
includeSymbols: true
Your build pipeline references an undefined variable named ‘Parameters.searchPatternPush’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972
steps:
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
packagesToPush: '$(Parameters.searchPatternPush)'
publishVstsFeed: '505cb4b9-0633-4d83-b4b6-1e5fc7ad020f'
问题:当我在 Azure devops 中对管道进行排队并且构建任务增加功能分支的版本时,如何使 my-app 6.1.0-dostuff0001 增加或更改?
请记住,我对所有这些构建、yml、配置等概念都是新手。
解决方案
为什么我的版本没有增加?
GitVersion 计算语义版本,每个版本只会更改一次。在版本增量中阅读更多信息
因此,为了使其增量,我们可以设置和使用一个配置文件:GitVersion.yml。下面 GitVersion.yml 供您参考,当从主分支触发时它对我有用。
mode: Mainline
tag-prefix: '[vV]'
commit-message-incrementing: MergeMessageOnly
branches:
feature:
regex: feature?[/-]
source-branches: ['develop']
release:
increment: Minor
regex: release?[/-]
develop:
is-mainline: true
increment: Patch
regex: develop$
master:
regex: master$
更多 GitVersion 相关信息请参考以下博客:
推荐阅读
- jquery - 你好 。我无法从 Jquery 数据表中获取数据。你能帮帮我吗?
- html - 如何在引导程序 4 中仅使中心面板可滚动,但将导航栏和侧边栏保持在固定位置?
- html - 单击 htmlunit 按钮没有响应。帮我
- python - 如何在 Python 中尽可能快地编写多个文件?
- c++ - 如何将 static_cast 与自定义对象一起使用?
- mysql - IFNULL 时使用 A,否则使用 + 1 个字母
- php - Laravel:如何存储在下拉字段中显示和选择的值作为输入,而不是 id
- javascript - REACT-APP Uncaught SyntaxError:无法在模块外使用导入语句
- windows - 循环批处理文件中隐藏文件不存在错误
- javascript - 基于名称和顺序参数在 JavaScript 中对数组进行排序