持续集成 - 最佳实践

发布于 2024-08-04 03:39:45 字数 101 浏览 4 评论 0原文

我最近一直在思考 CI 和自动构建,并且有兴趣了解是否有设置和维护持续集成环境的最佳实践。您是否将所有 CI 相关文件与项目源代码一起签入?您通常如何构建 CI 和构建文件?欢迎任何提示!

I've been thinking about CI and automatic builds a lot lately and am interested in knowing if there are any best practices for setting up and maintaining a continuous integration environment. Do you keep all your CI related files checked in with your project source? How would you usually structure your CI and build files? Any tips are welcome!

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

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

发布评论

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

评论(5

揪着可爱 2024-08-11 03:39:45
  1. 从一步构建开始。如果你没有这个,你就无法拥有任何合理的 CI
  2. 如果它不在源代码管理中,那么它就不存在
  3. 如果设置和维护你的 CI 超出了设置开发人员工作站的工作量,那么你就过度依赖了您的 IDE 或您的项目结构过于复杂。将其视为一个重构机会。
  4. 做 CI 不需要任何花哨的东西。您甚至不需要知道它是什么。我写了我之前的经历在我听说 CI 这个词之前,我就很幼稚 CI。
  1. Start with a one step build. If you don't have that, you can not have any reasonable CI
  2. If it isn't in source control, it doesn't exist
  3. If setting up and maintaining your CI exceeds the effort of setting up a developer workstation then you are overly dependent on your IDE or your project structure is overly complicated. Consider that as a refactoring opportunity.
  4. You don't need anything fancy to do CI. You don't even need to know what it is to do it. I wrote about my earlier experience here, when I implemented a naive CI before I ever heard the term CI.
無處可尋 2024-08-11 03:39:45

如果您还没有,请务必查看持续集成 马丁·福勒系列丛书,作者:杜瓦尔/马蒂亚斯/格洛弗。它通过坚实的示例涵盖了您深入提出的所有问题。

If you haven't already, definitely check out the Continuous Integration book from the Martin Fowler series, by Duvall/Matyas/Glover. It covers all of the questions you ask in depth with solid examples.

情深缘浅 2024-08-11 03:39:45

还有实用系列的“实用项目自动化”

当然,构建所需的所有文件都必须签入。否则 CI 将如何获取它们?

我已经将 CI 与 Java 结合使用,因此这意味着 Ant build.xml 以及 Cruise Control、Team City 或 Hudson。如果您坚持为项目使用一致的目录结构,则 build.xml 可能是通用的。

There's also the Pragmatic Series' "Pragmatic Project Automation".

Of course, all files required to build have to be checked in. How else would CI get at them?

I've used CI with Java, so that means an Ant build.xml and either Cruise Control, Team City, or Hudson. It's possible for the build.xml to be generic if you stick with a consistent directory structure for your projects.

倾城月光淡如水﹏ 2024-08-11 03:39:45

流行的 Jenkins/Hudson CI 工具的创始人 Kohsuke Kawaguchi 刚刚发布了一份可能对您有所帮助的白皮书。
优化 Jenkins 的 7 种方法

Kohsuke Kawaguchi, the founder of the popular Jenkins/Hudson CI tool, just published a white paper you might find helpful.
7 Ways to Optimize Jenkins

流年里的时光 2024-08-11 03:39:45

如果您的构建脚本开始变大,您可以将其拆分并包含相关部分。这使得维护和可读性更好。

我的其他建议与传统编程不同——在制作构建脚本时使用大量的注释。

If your build script starts getting big you can split it out and include the relevant parts. This makes maintenance and readability better.

My other advice would be unlike traditional programming - when making a build script make use of liberal amounts of comments.

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