维护持续集成的更好方法?

发布于 2024-09-08 10:12:48 字数 164 浏览 2 评论 0原文

我发现当我们添加新项目时,我总是在调整和调整我们的 CI 设置。虽然毫无疑问,对于很少更改的现有代码来说,好处是巨大的,但新项目或不稳定的项目似乎需要更多工作,因为我必须将每个项目配置为“集成”并维护不断增长的 CCNET.config文件。除了构建一个实用程序来管理添加和修改 CI 设置之外,是否有更好的策略?

I find that I am always tuning and tweaking our CI setup as we add new projects. While there is NO question that the benefits are awesome for existing code that seldom changes, new projects or volitile ones seem to require more work as I have to configure each project to be "intergrated" as well as maintain an ever-growing CCNET.config file. Is there a better strategy short of building an utility to manage adding and modifying a CI setup?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

又怨 2024-09-15 10:12:48

我做了一些事情来尝试控制它:

1)将配置文件分成两个。我有一个文件大部分保持不变,并包含一组常量,例如,

<?xml version="1.0" encoding="utf-8"?>
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
  <!-- Constant definition used by the projecct config to prevent changes being required for each iteration -->
  <cb:define branch="branch name for source control"/>
  <cb:define ciserver="Server name in here"/>
  <cb:define devenv="Path to DEVENV"/>
  <cb:define nunit="Path to NUNIT"/>
  <cb:define cruisecontrol="Cruisecontrol Path"/>

  <!-- Include file to the standard CI project definitions. This file is kept under source control -->
  <cb:include href="config\CCProjects.config"/>
</cruisecontrol>

使用常量允许您进行单个更改,并将其传播到配置文件中的每个任务。

请参阅 docs

2) 将包含项目的文件保存在源头控制。项目文件作为 SVN 签出的一部分进行更新。这有助于跟踪所做的更改,并让您轻松回滚。

也许已经到了 CC.Net 与您作对而不是为您服务的地步。我听说过其他 CI 服务器易于配置的好消息,例如 Hudson,但事实可能并非如此非常适合您的构建环境。

I do a few things to try keep it under control:

1) Split the config file into two. I have one file that mostly stays the same and contains a set of constants e.g.

<?xml version="1.0" encoding="utf-8"?>
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
  <!-- Constant definition used by the projecct config to prevent changes being required for each iteration -->
  <cb:define branch="branch name for source control"/>
  <cb:define ciserver="Server name in here"/>
  <cb:define devenv="Path to DEVENV"/>
  <cb:define nunit="Path to NUNIT"/>
  <cb:define cruisecontrol="Cruisecontrol Path"/>

  <!-- Include file to the standard CI project definitions. This file is kept under source control -->
  <cb:include href="config\CCProjects.config"/>
</cruisecontrol>

The use of constants allows you to make a single change and have it propagate through each task in the config file.

See docs

2) Keep the file with the projects in under source control. The project file gets updated as part of the SVN checkout. This helps track changes that get made and let you rollback without too much hassle.

Maybe it has got to the point where CC.Net is working against you rather than for you. I've heard good things about the ease of configuration of other CI servers, like Hudson, but it may not be a good fit with your build environment.

挽容 2024-09-15 10:12:48

1/ 根据需要拆分配置文件

例如,我有一个常量部分,每个项目都是一个包含,因此我可以相当独立地更新每个项目并跨项目使用常量。

ccnet.config

<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
  <!-- Shared constants -->
  <cb:define WorkingFolderBase="D:\dev\ContinuousIntegration\WC" />
  <cb:define ArtifactFolderBase="D:\dev\ContinuousIntegration\Artifact" />
  <cb:define ConfigFolder="projects" />
  <cb:define SvnBasePath="http://myserver.com/svn" />
  <cb:define SvnUsername="Myusername" />
  <cb:define SvnPassword="MyPassword" />

  <!-- MyProject1  -->
  <cb:include href="projects/MyProject1.config"/>

  <!-- MyProject2  -->
  <cb:include href="projects/MyProject2.config"/>
</cruisecontrol>

MyProject1.config

<project name="MyProject1" queue="Q1" queuePriority="1">
  <artifactDirectory>$(ArtifactFolderBase)\MyProject1</artifactDirectory>
  <workingDirectory>$(WorkingFolderBase)\MyProject1</workingDirectory>
  <!-- SVN implementation -->
  <sourcecontrol type="svn" username="$(SvnUsername)" password="$(SvnPassword)">
    <trunkUrl>$(SvnBasePath)/MyProject1/trunk/</trunkUrl>
    <workingDirectory>$(WorkingFolderBase)\MyProject1</workingDirectory>
  </sourcecontrol>
  [...]
</project>

2/ 在 CC.NET(我建议在整个安装中)或配置文件上使用版本控制。

3/ 保持简单!通过批处理文件执行所有操作(编译应用程序、编译测试、运行测试、获取覆盖率、静态分析器、生成报告...)。

1/ Split your config file as you want

For example, I have a constants section, and each project is an include, so I can update each project quite independently and use constants across projects.

ccnet.config

<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
  <!-- Shared constants -->
  <cb:define WorkingFolderBase="D:\dev\ContinuousIntegration\WC" />
  <cb:define ArtifactFolderBase="D:\dev\ContinuousIntegration\Artifact" />
  <cb:define ConfigFolder="projects" />
  <cb:define SvnBasePath="http://myserver.com/svn" />
  <cb:define SvnUsername="Myusername" />
  <cb:define SvnPassword="MyPassword" />

  <!-- MyProject1  -->
  <cb:include href="projects/MyProject1.config"/>

  <!-- MyProject2  -->
  <cb:include href="projects/MyProject2.config"/>
</cruisecontrol>

MyProject1.config

<project name="MyProject1" queue="Q1" queuePriority="1">
  <artifactDirectory>$(ArtifactFolderBase)\MyProject1</artifactDirectory>
  <workingDirectory>$(WorkingFolderBase)\MyProject1</workingDirectory>
  <!-- SVN implementation -->
  <sourcecontrol type="svn" username="$(SvnUsername)" password="$(SvnPassword)">
    <trunkUrl>$(SvnBasePath)/MyProject1/trunk/</trunkUrl>
    <workingDirectory>$(WorkingFolderBase)\MyProject1</workingDirectory>
  </sourcecontrol>
  [...]
</project>

2/ Use version control on CC.NET (I recommand on the whole installation) or on config files.

3/ Keep it simple! have all actions executed by a batch file (Compile applciation, compile tests, run tests, get coverage, static analyser, generate reports ...).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文