简体   繁体   English

GitVersion:多个候选发布被 Octopus Deploy 拒绝超过 Nuget 包版本

[英]GitVersion: Multiple release candidates rejected by Octopus Deploy over Nuget package version

I'm using GitVersion to do semantic versioning of a .net product I'm building.我正在使用GitVersion对我正在构建的 .net 产品进行语义版本控制。 During the work on a specific version I typically deploy several release candidates to the "dev" and "staging" environments.在特定版本的工作期间,我通常会将多个候选版本部署到“开发”和“暂存”环境。

When I try to deploy via Octopus Deploy it turns out that all release candidates share the same Nuget package version.当我尝试通过Octopus Deploy 进行部署时,结果发现所有候选版本都共享相同的 Nuget 包版本。 So Octopus plays nice with the first release candidate but refuses to accept the following RCs.所以 Octopus 对第一个候选版本很满意,但拒绝接受以下 RC。

What is the best way to make the Nuget package version reflect the difference between release candidates so that Octopus accepts them to its Nuget store?使 Nuget 包版本反映候选发布版本之间的差异以便 Octopus 接受它们到其 Nuget 商店的最佳方法是什么?

Additional details:额外细节:

  • I am employing GitHub Flow so only master and feature branches and deployments are always from master.我正在使用 GitHub Flow,所以只有 master 和 feature 分支和部署总是来自 master。
  • My build tool is TeamCity.我的构建工具是 TeamCity。

Probably your best bet, based on your description, would be to switch to using Continuous Deployment mode.根据您的描述,您最好的选择可能是切换到使用持续部署模式。

This is documented here:这是记录在这里:

http://gitversion.readthedocs.io/en/latest/more-info/incrementing-per-commit/ http://gitversion.readthedocs.io/en/latest/more-info/incrementing-per-commit/

This will basically switch GitVersion into a mode that creates a new, unique version number, for each commit in the repository.这基本上会将 GitVersion 切换到为存储库中的每个提交创建新的唯一版本号的模式。 You can then tag at specific points to order to move the version number forward.然后,您可以在特定点标记以将版本号向前移动。 This same technique is used on the GitVersion GitHub repository itself. GitVersion GitHub 存储库本身也使用了相同的技术。

This configuration can be applied on specific branches, if required.如果需要,此配置可以应用于特定分支。

I don't know how and where you are building your projects.我不知道你是如何以及在哪里构建你的项目。 But you should name your package versioning like the following options.The biggest version numbered nuget pakage will be the latest Octopus Release.但是你应该像下面的选项一样命名你的包版本。编号最大的 nuget 包将是最新的 Octopus 版本。 If you are packaging with different code repository branches, you should fail if the version numbers are the same.如果你用不同的代码库分支打包,如果版本号相同,你应该失败。 You should add branch names "1.0.0.0-dev" , "1.0.0.0-master" "1.0.0.0-hotfix" at the end of the version number.您应该在版本号的末尾添加分支名称 "1.0.0.0-dev" 、 "1.0.0.0-master" "1.0.0.0-hotfix" 。

for TFS build template (build number format) $(Date:yy.MMdd.HH.mm)用于TFS 构建模板(构建号格式)$(Date:yy.MMdd.HH.mm)

for TFS nugetter build template (Version or Version seed file path) 0.0.JB-Hotfix用于TFS nugetter构建模板(版本或版本种子文件路径)0.0.JB-Hotfix

for Jenkins version number plugin ${BUILD_YEAR}.${BUILD_MONTH}.${BUILD_DAY}.${BUILDS_TODAY}对于Jenkins 版本号插件${BUILD_YEAR}.${BUILD_MONTH}.${BUILD_DAY}.${BUILDS_TODAY}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM