且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

每晚构建:为什么要这样做?

更新时间:2023-09-29 22:06:46

您应该每晚进行构建,以确保您的代码库保持健康.

You should do nightly builds to ensure that your codebase stays healthy.

每晚进行构建的一个副作用是,它迫使团队创建并维护一个完全自动化的构建脚本.这有助于确保您的构建过程得到记录并可以重复.

A side effect of doing nightly builds is that it forces the team to create and maintain a fully automated build script. This helps to ensure that your build process is documented and repeatable.

自动构建擅长于发现以下问题:

Automated builds are good at finding the following problems:

  • 有人签了一些会破坏东西的东西.
  • 有人忘记签入必要的文件或进行更改.
  • 您的构建脚本不再起作用.
  • 您的构建机器坏了.

每晚进行一次此操作可确保您在发生此类问题后24小时内抓住它们.这比在交付软件前24小时发现所有问题更为可取.

Doing this nightly ensures that you catch such problems within 24 hours of when they occur. That is preferable to finding all the problems 24 hours before you are supposed to deliver the software.

当然,您还应该为每个每晚的构建运行自动化的单元测试.

You should also, of course, have automated unit tests that are run for each nightly build.