在源代码管理中管理存储构建的最佳方法是什么?

时间:2021-11-14 20:07:40

I'm using Perforce, if that changes the tune of the answers at all.

我正在使用Perforce,如果这改变了答案的曲调。

I'd like to implement a build process that, when a solution is built in a "release" mode, tags the entire source tree with a label and pushes the output of the build (DLLs, webpages) to a /build/release directory in source control. This directory should always contain the latest complete build, nothing less and nothing more, so I can yank that directory to production servers in its entirety and it's ready to go.

我想实现一个构建过程,当一个解决方案以“发布”模式构建时,用标签标记整个源代码树并将构建的输出(DLL,webpages)推送到/ build / release目录在源代码管理中。这个目录应该总是包含最新的完整版本,没有更多,所以我可以完全将该目录拉到生产服务器上,它已经准备好了。

Now say I had a DLL in a previous release that the new build is not supposed to include. Does this mean the best practice for updating that /build/release folder is to check the entire thing out, delete everything in it, add the new build files, and sync it? Sounds like an obvious answer, but I want to make sure I'm not missing some other voodoo that might be a better way to do it.

现在说我在之前的版本中有一个DLL,新版本不应该包含。这是否意味着更新/ build / release文件夹的最佳做法是检查整个内容,删除其中的所有内容,添加新的构建文件并同步它?听起来像一个明显的答案,但我想确保我不会错过其他可能更好的方法。

2 个解决方案

#1


I think you are missing the simple voodoo:) You should consider just using a plain old file system for your build drops. Source control is designed to manage change, versioning, and collaboration and there really is no need for any of this related to builds. The whole point to an build system is to be able to reproduce the source code and create the application at a moments notice so I would focus on being able to do that more than relying on the permanent storage of the output files. Be sure to back up the build drop folder structure just as you would the source control database. Use a folder naming scheme that includes the build number in the filename. I would store all of the builds (back at least several) because there are times when QA wants to restore an old build to test in order to compare features or resurrect a bug. Using this system every build gets a new folder so you don';t have to worry about deleting out old files.

我想你错过了简单的伏都教:)你应该考虑使用一个普通的旧文件系统来构建你的构建版本。源代码控制旨在管理变更,版本控制和协作,而且实际上不需要与构建相关的任何内容。构建系统的重点是能够在瞬间通知时重现源代码并创建应用程序,因此我将专注于能够做到这一点,而不是依赖于输出文件的永久存储。确保像源控制数据库一样备份构建drop文件夹结构。使用包含文件名中的内部版本号的文件夹命名方案。我会存储所有构建(至少返回几个),因为有时QA想要恢复旧构建以进行测试以便比较功能或复活bug。使用此系统,每个构建都会获得一个新文件夹,因此您不必担心删除旧文件。

#2


I'd say "Yes" - you should to start with a blank folder structure for your builds (regardless of source control system).

我会说“是” - 您应该从构建的空白文件夹结构开始(无论源控制系统如何)。

#1


I think you are missing the simple voodoo:) You should consider just using a plain old file system for your build drops. Source control is designed to manage change, versioning, and collaboration and there really is no need for any of this related to builds. The whole point to an build system is to be able to reproduce the source code and create the application at a moments notice so I would focus on being able to do that more than relying on the permanent storage of the output files. Be sure to back up the build drop folder structure just as you would the source control database. Use a folder naming scheme that includes the build number in the filename. I would store all of the builds (back at least several) because there are times when QA wants to restore an old build to test in order to compare features or resurrect a bug. Using this system every build gets a new folder so you don';t have to worry about deleting out old files.

我想你错过了简单的伏都教:)你应该考虑使用一个普通的旧文件系统来构建你的构建版本。源代码控制旨在管理变更,版本控制和协作,而且实际上不需要与构建相关的任何内容。构建系统的重点是能够在瞬间通知时重现源代码并创建应用程序,因此我将专注于能够做到这一点,而不是依赖于输出文件的永久存储。确保像源控制数据库一样备份构建drop文件夹结构。使用包含文件名中的内部版本号的文件夹命名方案。我会存储所有构建(至少返回几个),因为有时QA想要恢复旧构建以进行测试以便比较功能或复活bug。使用此系统,每个构建都会获得一个新文件夹,因此您不必担心删除旧文件。

#2


I'd say "Yes" - you should to start with a blank folder structure for your builds (regardless of source control system).

我会说“是” - 您应该从构建的空白文件夹结构开始(无论源控制系统如何)。