在我的构建工作流程中,我更改了 AssemblyInfo.cs 中的程序集版本信息。仅当构建成功时,如何才能在构建过程结束时 checkin 更改?
最佳答案
- 在 TeamCity 项目中创建新的构建配置。
在新的构建配置中,转到“构建步骤”并添加“构建功能”,然后选择“AssemblyInfo Patcher”。
AssemblyInfo Patcher build feature allows to set a build number to an assembly automatically, without having to patch AssemblyInfo.cs files manually. When adding this build feature you need only to specify version format.
添加另一个构建步骤,该步骤将在当前工作区中提交挂起的更改 - Checkin Command .
在您的主项目中,转到“构建触发器”
"Build triggers are used to add builds to the queue either when an event occurs (like a VCS check-in) or periodically with some configurable interval."
在构建触发中添加新触发器 - “完成构建触发器”
Finished Build Trigger will add a build to the queue after a build finishes in the selected configuration.
在“构建配置”中,选择之前创建的构建项目(步骤 1),并且不要忘记选中“仅在成功构建后触发”复选框。
关于teamcity - 仅当构建成功时才 checkin 更新程序集版本信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18954504/