<p>Or, actually establishing a build process when there isn't much of one in place to begin with.</p>

<p>Currently, that's pretty much the situation my group faces.  We do web-app development primarily (but no desktop development at this time).  Software deployments are ugly and unwieldy even with our modest apps, and we've had far too many issues crop up in the two years I have been a part of this team (and company).  It's past time to do something about that, and the upshot is that we'll be able to kill two Joel Test birds with one stone (daily builds and one-step builds, neither of which exists in any form whatsoever).</p>

<p>What I'm after here is some general insight on the kinds of things I need to be doing or thinking about, from people who have been in software development for longer than I have and also have bigger brains.  I'm confident that will be most of the people currently posting in the beta.</p>

<p>Relevant Tools:
Visual Build
Source Safe 6.0 (I know, but I can't do anything about whether or not we use Source Safe at this time.  That might be the next battle I fight.)</p>

<p>Tentatively, I've got a Visual Build project that does this:</p>

<ol>
<li>Get source and place in local directory, including necessary DLLs needed for project.</li>
<li>Get config files and rename as needed (we're storing them in a special sub directory that isn't part of the actual application, and they are named according to use).</li>
<li>Build using Visual Studio</li>
<li>Precompile using command line, copying into what will be a "build" directory</li>
<li>Copy to destination.</li>
<li>Get any necessary additional resources - mostly things like documents, images, and reports that are associated with the project (and put into directory from step 5).  There's a lot of this stuff, and I didn't want to include it previously.  However, I'm going to only copy changed items, so maybe it's irrelevant.  I wasn't sure whether I really wanted to include this stuff in earlier steps.</li>
</ol>

<p>I still need to coax some logging out of Visual Build for all of this, but I'm not at a point where I need to do that yet.</p>

<p>Does anyone have any advice or suggestions to make?  We're not currently using a Deployment Project, I'll note.  It would remove some of the steps necessary in this build I presume (like web.config swapping).</p>

[{'answer_id': 14903, 'author': 'Eric Z Beard', 'author_id': 1219, 'author_profile': 'https://Stackoverflow.com/users/1219', 'pm_score': 3, 'selected': False, 'text': '<p>I have a set of Powershell scripts that do all of this for me.</p>\n\n<p>Script 1: Build - this one is simple, it is mostly handled by a call to msbuild, and also it creates my database scripts.</p>\n\n<p>Script 2: Package - This one takes various arguments to package a release for various environments, such as test, and subsets of the production environment, which consists of many machines.</p>\n\n<p>Script 3: Deploy - This is run on each individual machine from within the folder created by the Package script (the Deploy script is copied in as a part of packaging)</p>\n\n<p>From the deploy script, I do sanity checks on things like the machine name so things don\'t accidentally get deployed to the wrong place.</p>\n\n<p>For web.config files, I use the </p>\n\n<pre><code>&lt;appSettings file="Local.config"&gt;\n</code></pre>\n\n<p>feature to have overrides that are already on the production machines, and they are read-only so they don\'t accidentally get written over.  The Local.config files are not checked in, and I don\'t have to do any file switching at build time.</p>\n\n<p>[Edit] The equivalent of appSettings file= for a config section is configSource="Local.config"</p>\n'}, {'answer_id': 14910, 'author': 'Mike Deck', 'author_id': 1247, 'author_profile': 'https://Stackoverflow.com/users/1247', 'pm_score': 1, 'selected': False, 'text': '<p>I\'ve only worked on a couple of .Net projects (I\'ve done mostly Java) but one thing I would recommend is using a tool like <a href="http://nant.sourceforge.net/" rel="nofollow noreferrer">NAnt</a>.  I have a real problem with coupling my build to the IDE, it ends up making it a real pain to set up build servers down the road since you have to go do a full VS install on any box that you want to build from in the future.</p>\n\n<p>That being said, any automated build is better than no automated build.</p>\n'}, {'answer_id': 14935, 'author': 'John Sibly', 'author_id': 1078, 'author_profile': 'https://Stackoverflow.com/users/1078', 'pm_score': 3, 'selected': False, 'text': '<p>We switched from using a perl script to MSBuild two years ago and haven\'t looked back.\nBuilding visual studio solutions can be done by just specifying them in the main xml file.</p>\n\n<p>For anything more complicated (getting your source code, executing unit tests, building install packages, deploying web sites) you can just create a new class in .net deriving from <em>Task</em> that overrides the Execute function, and then reference this from your build xml file.</p>\n\n<p>There is a pretty good introduction here:\n<a href="http://en.csharp-online.net/MSBuild:_By_Example" rel="noreferrer">introduction</a></p>\n'}, {'answer_id': 14953, 'author': 'Brian Ensink', 'author_id': 1254, 'author_profile': 'https://Stackoverflow.com/users/1254', 'pm_score': 1, 'selected': False, 'text': '<p>Our build process is a bunch of homegrown Perl scripts that have evolved over a decade or so, nothing fancy but it gets the job done.  One script gets the latest source code, another builds it, a third stages it to a network location.  We do desktop application development so our staging process also builds install packages for testing and eventually shipping to customers.</p>\n\n<p>I suggest you break it down to individual steps because there will be times when you want to rebuild but not get latest, or maybe just need to re-stage.  Our scripts can also handle building from different branches so consider that also with whatever solution you develop.</p>\n\n<p>Finally we have a dedicated build machine that rebuilds the trunk and maintenance branches every night and sends out an email with any problems or if it completed successfully.</p>\n'}, {'answer_id': 14979, 'author': 'BCS', 'author_id': 1343, 'author_profile': 'https://Stackoverflow.com/users/1343', 'pm_score': 0, 'selected': False, 'text': '<p>Our build system is a makefile (or two). It has been rather fun getting it working as it needs to run on both windows (as a build task under VS) and under Linux (as a normal "make bla" task). The really fun thing is that the build gets the actual file list from a .csproj file, builds (another) makefile from that, and run that. In the processes the make file actually calls it\'s self.</p>\n\n<p>If that thought doesn\'t scare the reader, then (either they are crazy or) they can probably get make + "your favorite string mangler" to work for them.</p>\n'}, {'answer_id': 15011, 'author': 'Dale Ragan', 'author_id': 1117, 'author_profile': 'https://Stackoverflow.com/users/1117', 'pm_score': 5, 'selected': True, 'text': '<p>When taking on a project that has never had an automated build process, it is easier to take it in steps.  Do not try to swallow to much at one time, otherwise it can feel overwhelming.</p>\n\n<ol>\n<li>First get your code compiling with one step using an automated build program (i.e. nant/msbuild).  I am not going to debate which one is better.  Find one that feels comfortable to you and use it.  Have the build scripts live with the project in source control.</li>\n<li>Figure out how you want your automated build to be triggered.  Whether it is hooking it up to CruiseControl or running a nightly build task using Scheduled Tasks.  CruiseControl or TeamCity is probably the best choice for this, because they include a lot of tools you can use to make this step easier.  CruiseControl is free and TeamCity is free to a point, where you might have to pay for it depending on how big the project is.</li>\n<li>Ok, by this point you will be pretty comfortable with the tools.  Now you are ready to add more tasks based on what you want to do for testing, deployment, and etc...</li>\n</ol>\n\n<p>Hope this helps.</p>\n'}, {'answer_id': 34947, 'author': 'Gern Blanston', 'author_id': 2786, 'author_profile': 'https://Stackoverflow.com/users/2786', 'pm_score': 1, 'selected': False, 'text': '<p>One thing I would suggest ensure your build script (and installer project, if relevant in your case) is in source control.  I tend to have a very simple script that just checks out\\gets latest the "main" build script then launches it.  </p>\n\n<p>I say this b/c I see teams just running the latest version of the build script on the server but either never putting it in source control or when they do they only check it in on a random basis.  If you make the build process to "get" from source control it will force you to keep the latest and greatest build script in there.</p>\n'}, {'answer_id': 873047, 'author': 'ferventcoder', 'author_id': 18475, 'author_profile': 'https://Stackoverflow.com/users/18475', 'pm_score': 0, 'selected': False, 'text': '<p>We use UppercuT.\nUppercuT uses NAnt to build and it is extremely easy to use.</p>\n\n<p><a href="http://code.google.com/p/uppercut/" rel="nofollow noreferrer">http://code.google.com/p/uppercut/</a></p>\n\n<p>Some good explanations here: <a href="http://ferventcoder.com/category/10094.aspx" rel="nofollow noreferrer">UppercuT</a></p>\n'}]
['https://Stackoverflow.com/questions/14893', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1734/']