Build or rebuild on the build server (CI server)

I run TeamCity to create a .NET project (more precisely, for several projects).

Should I use a Rebuild goal or create a goal?

I would like to minimize the build time without creating new versions of projects that have not changed.

Is this safe practice to use the "build" goal? What if previous project results were erased? how can i check if i can do it safely?

+4
source share
4 answers

You should use rebuild if you need to rebuild all projects, for example, to get consistent timestamps or version numbers (although usually changing the associated AssemblyInfo.cs also causes the assembly.)

The assembly is completely safe, even if the assembly did not exit the previous assembly, or even if the assembly is performed on a new assembly agent that does not have the assembly output. In this case, all the necessary projects will be created.

However, you may have custom MSBuild steps in your sln / csproj files that depend on the assembly (Re), in which case you need to be more careful, but besides that, go to the assembly if you want.

+6
source

You should always perform rebuild operations on continuous integration servers.

Unlike what you can read, there may be a leak from the previous assembly to the current one. A leak is almost never the result of a failure to compile the source code into binary files, but depending on which tool you use to build, there may be files without code that are not copied because they already exist in the output directory or deleted files. which are not removed from it.

For similar reasons, if you can afford the expense of runtime, you should also always clear the source tree before assembly. Either destroy it, or check a clean copy, or discard any changes and delete all files that are not under the control of the source. If you do not do this in every assembly, at least you do it in idle mode (for example, at night or on weekends), as well as in assemblies that you intend to actually deliver to customers or deploy to production (and ideally in QA).

+2
source

Build creates everything you need to run a project, while maintaining invariable builds. Reconstruction creates a complete assembly of any assembled assembly. If for specific circumstances (version number, dependent process is not used), you can use build to minimize the time spent.

+1
source

You should use Build to gradually build your project. It is absolutely safe.

+1
source

Source: https://habr.com/ru/post/1382489/


All Articles