<p>Setting up an integration server, I’m in doubt about the best approach regarding using multiple tasks to complete the build. Is the best way to set all in just one big-job or make small dependent ones?</p>

[{'answer_id': 29972, 'author': 'Sean Chambers', 'author_id': 2993, 'author_profile': 'https://Stackoverflow.com/users/2993', 'pm_score': 1, 'selected': False, 'text': '<p>I use TeamCity with an nant build script. TeamCity makes it easy to setup the CI server part, and nant build script makes it easy to do a number of tasks as far as report generation is concerned.</p>\n\n<p>Here is an article I wrote about using CI with CruiseControl.NET, it has a nant build script in the comments that can be re-used across projects:</p>\n\n<p><a href="http://www.codeproject.com/KB/cs/Continuous_Integration.aspx" rel="nofollow noreferrer">Continuous Integration with CruiseControl</a></p>\n'}, {'answer_id': 29973, 'author': 'a_hardin', 'author_id': 1497, 'author_profile': 'https://Stackoverflow.com/users/1497', 'pm_score': 0, 'selected': False, 'text': "<p>I would definitely break down the jobs.  Chances are you're likely to make changes in the builds, and it'll be easier to track down issues if you have smaller tasks instead of searching through one monolithic build.</p>\n\n<p>You should be able to create one big job from the smaller pieces, anyways.</p>\n"}, {'answer_id': 29978, 'author': 'Matt Hinze', 'author_id': 2676, 'author_profile': 'https://Stackoverflow.com/users/2676', 'pm_score': 3, 'selected': True, 'text': '<p>You definitely want to break up the tasks.  Here is a nice example of CruiseControl.NET configuration that has different targets (tasks) for each step.  It also uses a common.build file which can be shared among projects with little customization.</p>\n\n<p><a href="http://code.google.com/p/dot-net-reference-app/source/browse/#svn/trunk" rel="nofollow noreferrer">http://code.google.com/p/dot-net-reference-app/source/browse/#svn/trunk</a></p>\n'}, {'answer_id': 29991, 'author': 'Rob Wells', 'author_id': 2974, 'author_profile': 'https://Stackoverflow.com/users/2974', 'pm_score': 0, 'selected': False, 'text': "<p>G'day,</p>\n\n<p>As you're talking about integration testing my big (obvious) tip would be to make the test server built and configured as close as possible to the deployment environment as possible.</p>\n\n<pre><code>&lt;/thebloodyobvious&gt; (-:\n</code></pre>\n\n<p>cheers,\nRob</p>\n"}, {'answer_id': 30025, 'author': 'Shaun Austin', 'author_id': 1120, 'author_profile': 'https://Stackoverflow.com/users/1120', 'pm_score': 1, 'selected': False, 'text': "<p>The approach I favour is the following setup (Actually assuming you are in a .NET project):</p>\n\n<ul>\n<li>CruiseControl.NET.</li>\n<li>NANT tasks for each individual step. Nant.Contrib for alternative CC templates.</li>\n<li>NUnit to run unit tests.</li>\n<li>NCover to perform code coverage.</li>\n<li>FXCop for static analysis reports.</li>\n<li>Subversion for source control.</li>\n<li>CCTray or similar on all dev boxes to get notification of builds and failures etc.</li>\n</ul>\n\n<p>On many projects you find that there are different levels of tests and activities which take place when someone does a checkin. Sometimes these can increase in time to the point where it can be a long time after a build before a dev can see if they have broken the build with a checkin. </p>\n\n<p>What I do in these cases is create three builds (or maybe two):</p>\n\n<ul>\n<li>A CI build is triggered by checkin and does a clean SVN Get, Build and runs lightweight tests. Ideally you can keep this down to minutes or less.</li>\n<li>A more comprehensive build which could be hourly (if changes) which does the same as the CI but runs more comprehensive and time consuming tests.</li>\n<li>An overnight build which does everything and also runs code coverage and static analysis of the assemblies and runs any deployment steps to build daily MSI packages etc.</li>\n</ul>\n\n<p>The key thing about any CI system is that it needs to be organic and constantly being tweaked. There are some great extensions to CruiseControl.NET which log and chart build timings etc for the steps and let you do historical analysis and so allow you to  continously tweak the builds to keep them snappy. It's something that managers find hard to accept that a build box will probably keep you busy for a fifth of your working time just to stop it grinding to a halt.</p>\n"}, {'answer_id': 30690, 'author': 'Nathan Black', 'author_id': 3265, 'author_profile': 'https://Stackoverflow.com/users/3265', 'pm_score': 1, 'selected': False, 'text': '<p>We use <a href="http://buildbot.net/trac" rel="nofollow noreferrer">buildbot</a>, with the build broken down into discrete steps. There is a balance to be found between having build steps be broken down with enough granularity and being a complete unit.</p>\n\n<p>For example at my current position, we build the sub-pieces for each of our platforms (Mac, Linux, Windows) on their respective platforms. We then have a single step (with a few sub steps) that compiles them into the final version that will end up in the final distributions.</p>\n\n<p>If something goes wrong in any of those steps it is pretty easy to diagnose.</p>\n\n<p>My advice is to write the steps out on a whiteboard in as vague terms as you can and then base your steps on that. In my case that would be:</p>\n\n<ol>\n<li>Build Plugin Pieces\n\n<ol>\n<li>Compile for Mac</li>\n<li>Compile for PC</li>\n<li>Compile for Linux</li>\n</ol></li>\n<li>Make final Plugins</li>\n<li>Run Plugin tests</li>\n<li>Build intermediate IDE (We have to bootstrap building)</li>\n<li>Build final IDE</li>\n<li>Run IDE tests</li>\n</ol>\n'}, {'answer_id': 11436289, 'author': 'Peter Bernier', 'author_id': 6112, 'author_profile': 'https://Stackoverflow.com/users/6112', 'pm_score': 0, 'selected': False, 'text': "<p>Break your tasks up into discrete goal/operations, then use a higher-level script to tie them all together appropriately. </p>\n\n<p>This makes your build process easier to understand for other people (you're documenting as you go so anyone on your team can pick it up, right?), as well as increasing the potential for re-use. It's likely you won't reuse the high-level scripts (although this could be possible if you have similar projects), but you can definitely reuse (even if it's copy/paste) the discrete operations rather easily.</p>\n\n<p>Consider the example of getting the latest source from your repository. You'll want to group the tasks/operations for retrieving the code with some logging statements and reference the appropriate account information. This is the sort of thing that's very easy to reuse from one project to the next. </p>\n\n<p>For my team's environment, we use NAnt since it provides a common scripting environment between dev machines (where we write/debug the scripts) and the CI server (since we just execute the same scripts in a clean environment). We use Jenkins to manage our builds, but at their core each project is just calling into the same NAnt scripts and then we manipulate the results (ie, archive the build output, flag failing tests etc).</p>\n"}]
['https://Stackoverflow.com/questions/29971', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2267/']