将 CruiseControl 构建配置移植到 TeamCity
我有一堆与 CrusieControl 一起使用的 MSBUILD 文件。
我正在尝试将它们与 TeamCity 一起使用。
看起来我们正在使用的 MSBUILD proj 文件需要来自 CruiseControl 的参数,例如 CCNetArtifactDirectory 和 CCNetWorkingDirectory 等。
我不确定像工件这样的概念如何转化为团队城市。
我是否仍可以让 TeamCity 传入 Cruise Control 所具有的参数值?
TeamCity 是否传递我的 MSBULD proj 文件可以使用的任何变量?比如当前的工作目录是什么?我可以向 TeamCity 询问其工件目录吗?
如何使用 TeamCity 设置环境变量,以便为我的 MSBUILD proj 文件可以使用的名为 CCNetArtifactDirectory 的变量设置值?
I have a bunch of MSBUILD files that we used with CrusieControl.
I'm trying to use these with TeamCity.
It looks like the MSBUILD proj files that we're using are expecting parameters from CruiseControl like CCNetArtifactDirectory and CCNetWorkingDirectory to name a couple.
I'm not sure how concepts like artifacts translate to team city.
Can I still have TeamCity pass in values for parameters that Cruise Control would have?
Does TeamCity pass in any variables that my MSBULD proj files can use? Like what is the current working directory? Can I ask TeamCity for its artifacts directory?
How do I setup an environment variable with TeamCity so that I can set a value for a variable called CCNetArtifactDirectory which my MSBUILD proj files can use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您进入 TeamCity 中构建配置的“构建器参数”页面,会看到一个名为“系统属性”的部分。这些属性作为属性传递到 MSBuild。
因此,如果您设置名为“system.CCNetWorkingDirectory”的系统属性并将其设置为值“%teamcity.agent.work.dir%”,则 MSBuild 中的 CCNetWorkingDirectory 参数应填充代理的工作目录。当您在值字段中键入“%”时,TeamCity 会自动完成可用的构建参数,因此您应该能够使用该参数和 TeamCity 文档来查找所需内容。
对于工件,TeamCity 有自己的工件缓存系统,您可以在“常规设置”页面上的“工件路径”部分中指定工件。我建议您开始使用它来缓存您的工件,而不是让 MSBuild 脚本移动它们,除非您希望 MSBuild 将它们移动到暂存文件夹,然后让 TeamCity 从那里提取它们。
If you go the Builder Parameters page of the build configuration in TeamCity, there is a section called System Properties. These properties are passed in to MSBuild as properties.
So if you set up a System Property named "system.CCNetWorkingDirectory" and set it to the value "%teamcity.agent.work.dir%", then the CCNetWorkingDirectory parameter in MSBuild should be populated with the working directory of the agent. TeamCity provides auto-complete for the available build parameters when you type "%" in the value field, so you should be able to use that and the TeamCity documentation to find what you need.
For artifacts, TeamCity has its own artifact caching system and you can specify the artifacts in the Artifact Paths section on the General Settings page. I would recommend you start using that to cache your artifacts instead of having the MSBuild script move them, unless you want MSBuild to move them to a staging folder and then have TeamCity extract them from there.