使用 TeamCity 模板时如何使依赖关系相对?
当我复制使用模板的项目时,这些模板中的所有依赖项似乎都是“绝对的”。也就是说,复制后,新项目的构建配置依赖项将全部指向原始构建配置。
有没有办法使这项工作正常进行,以便模板中的依赖项与项目“相关”?
谢谢
When I copy a Project which uses templates, all the dependencies in those templates appear to be "absolute". That is after copying,it appears the new projects build configurations dependencies will all point back to the original build configurations.
Is there a way to make this work so that the dependencies in the templates are "relative" to the project?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AFAIK 目前无法完成。在 TeamCity 的错误数据库中搜索发现了三个错误/请求:
TW-18304 支持项目相对快照依赖项在构建配置模板(打开)中,
这对应于您的问题,但被认为是
TW-3287 项目模板(打开)
但是 TW-3287 的评论还建议使用:
TW-4612 项目级属性(已修复)
因此,您也许可以使用项目级属性来满足您的需求。根据项目的不同,您可以将不同项目中的构建配置基于通用模板,而这些模板又使用您在项目级别定义的属性进行参数化。模板不应包含依赖项,您需要在“原始”项目中配置这些依赖项。根据 TW-18304 的评论,该项目的简单副本实际上应该保留新复制的项目中的引用。还没有尝试过这些,但可能值得一试。
AFAIK it just can't be done at the moment. A search in the bug database of TeamCity leads to three bugs/requests:
TW-18304 Support project relative snapshot dependencies in a build configuration template (OPEN)
Which corresponds to your question, but is considered to be a duplicate of
TW-3287 Project templates (OPEN)
But a comment of TW-3287 also suggests the use of:
TW-4612 Project-level properties (FIXED)
So, you might be able to use project level properties to serve your needs. Depending on how the projects differ, you can base the build configurations in the different projects on common templates which in turn are parametrized with properties that you define on the project level. The templates should not contain dependencies, you will need to configure these in the 'original' project. According to a comment on TW-18304, a simple copy of the project should then actually keep the references within the newly copied project. Haven't tried any of this, but it might be worth a try.