将单个 TeamCity 构建配置从一台服务器移动到另一台服务器的最佳方式是什么?
我有一个本地 TeamCity 实例,我在此基础上进行测试。然后当构建足够成熟时,我在我们的主 TeamCity 服务器上手动创建它(眼球复制)。
是否有可以为我执行此操作的导出和导入功能?
最佳答案
不幸的是,没有这样的事情。 TeamCity 8 通过引入构建 ID 格式(项目名称 + 构建配置名称,可以覆盖)使“手动复制”构建配置变得可行,使情况有所改善:
基本上,您的所有 TeamCity 构建配置实际上只是 BuildServer\config\projects\文件夹和子文件夹中的 XML 文件。虽然我还没有尝试过,但如果 id 不冲突,您应该可以将项目文件夹或构建配置 XML 复制到新 TeamCity 实例上的适当目标。至少,您绝对可以通过这种方式使用更新覆盖现有项目(我过去曾做过“动态”动态更改构建配置的方法)。
当然,如果您的构建配置依赖于其他构建/工件,那么这些 id 也必须匹配,因此您必须同时复制它们或相应地调整 id。代理要求也是如此。
编辑:
随着 TeamCity 9 的推出,现在有一个更好的选择来在内置的 TeamCity 服务器之间移动项目:
Now TeamCity provides the ability to move projects among servers: you can transfer projects with all their data (settings, builds and changes history, etc.) and with your TeamCity user accounts from one server to another. All you need to do is create a usual backup file on the source TeamCity server containing the projects to be imported, put the backup file into the /import directory on the target server and follow the import steps on the Administration | Projects Import page.
完整摘要见 what's new in TeamCity 9 .
https://stackoverflow.com/questions/23224078/