<p>Seems like there are so many different ways of automating one's build/deployment that it becomes difficult to parse through all the different scenarios that people support in tutorials on the web.  So I wanted to present the question to the stackoverflow crowd ... what would be the best way to set up an automated build and deployment system using the following configuration:</p>

<ul>
<li>Visual Studio 2008</li>
<li>Web Application Project</li>
<li>CruiseControl.NET</li>
</ul>

<p>One of the first things I tried was to have CCnet automatically zip the output and copy it to the server, but then that requires manual work to unzip at the destination.  However, if we try to copy all the files individually, then it could potentially take a long time if it's a large application (build server lives outside of the datacenter in our office ... I know).</p>

<p>Also of particular interest is how we would support multiple environments as we have dev, qa, uat, and then of course prod.</p>

<p><a href="http://blogs.iis.net/msdeploy/archive/2008/01/22/welcome-to-the-web-deployment-team-blog.aspx" rel="noreferrer">MSDeploy</a> seems really interesting, but unless I'm interpreting the literature incorrectly, doesn't help in the scenario of deploying from the output of a build server.  If anything, it seems like it'll be useful in deploying one build across a build farm ... but even for deploying from one environment to another, one would have to manually change config settings and web service URLs, etc.</p>

[{'answer_id': 57825, 'author': 'Iain', 'author_id': 5993, 'author_profile': 'https://Stackoverflow.com/users/5993', 'pm_score': 3, 'selected': False, 'text': '<p>You might be interested in <a href="http://blogs.iis.net/msdeploy/archive/2008/01/22/welcome-to-the-web-deployment-team-blog.aspx" rel="noreferrer">MSDeploy</a>. <a href="http://www.hanselman.com/blog/MSDeployNewIISWebDeploymentTool.aspx" rel="noreferrer">Here\'s</a> a Scott Hanselman post on this. It\'s only available as a technical preview at the moment (September 2008) but is worth evaluating against your requirements.</p>\n'}, {'answer_id': 59274, 'author': 'Simon Steele', 'author_id': 4591, 'author_profile': 'https://Stackoverflow.com/users/4591', 'pm_score': 1, 'selected': False, 'text': '<p>I had a <a href="https://stackoverflow.com/questions/55323/aspnet-web-application-build-output-how-do-i-include-all-deployment-files">related question</a> about getting a deployable set of files from an automated build. I found Web Deployment Projects (links and all in the old question) did what I needed - they\'re a VS and MSBuild add-on.</p>\n'}, {'answer_id': 59291, 'author': 'Chris Miller', 'author_id': 206, 'author_profile': 'https://Stackoverflow.com/users/206', 'pm_score': 2, 'selected': False, 'text': '<p>Do you have the ability to run commands remotely?  The <a href="http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx" rel="nofollow noreferrer">PsExec</a> utility from <a href="http://technet.microsoft.com/en-us/sysinternals/default.aspx" rel="nofollow noreferrer">Systinternals</a> would let run a command line unzip program on the remote machine.  If you have a script that copies the build as a .zip file to the remote site, you would just need one more line for the PsExec call to unzip the files.</p>\n'}, {'answer_id': 59307, 'author': 'Sam Wessel', 'author_id': 4734, 'author_profile': 'https://Stackoverflow.com/users/4734', 'pm_score': 5, 'selected': True, 'text': '<p>I recently spent a few days working on automating deployments at my company.</p>\n\n<p>We use a combination of CruiseControl, NAnt, MSBuild to generate a release version of the app. Then a separate script uses MSDeploy and XCopy to backup the live site and transfer the new files over.</p>\n\n<p>Our solution is briefly described in an answer to this question <a href="https://stackoverflow.com/questions/45783/automate-deployment-for-web-applications">Automate Deployment for Web Applications?</a></p>\n'}, {'answer_id': 1317787, 'author': 'netbuild', 'author_id': 161464, 'author_profile': 'https://Stackoverflow.com/users/161464', 'pm_score': 2, 'selected': False, 'text': '<p>There is another new build tool (a very intelligent wrapper) called <strong>NUBuild</strong>. Its lightweight, open source and extremely easy to setup and provides almost no-touch maintenance. I really like this new tool and we have made it standard tool for our continuous build and integration process of our projects (we have about 400 projects across 75 developers). Try it out.</p>\n\n<p><a href="http://nubuild.codeplex.com/" rel="nofollow noreferrer">http://nubuild.codeplex.com/</a></p>\n\n<ul>\n<li>Easy to use command line interface</li>\n<li>Ability to target all .Net framework\nversion i.e. 1.1, 2.0, 3.0 and 3.5</li>\n<li>Supports XML based configuration</li>\n<li>Supports both project and file\nreferences</li>\n<li>Automatically generates the “complete\nordered build list” for a given\nproject – No touch maintenance.</li>\n<li>Ability to detect and display\ncircular dependencies</li>\n<li>Perform parallel build -\nautomatically decides which of the\nprojects in the generated build list\ncan be built independently.</li>\n<li>Ability to handle proxy assemblies</li>\n<li>Provides visual clue to the build\nprocess e.g. showing “% completed”,\n“current status” etc.</li>\n<li>Generates detailed execution log both\nin XML and text format</li>\n<li>Easily integrated with\nCruise-Control.Net continuous\nintegration system</li>\n<li>Can use custom logger like XMLLogger\nwhen targeting 2.0 + version</li>\n<li>Ability to parse error logs</li>\n<li>Ability to deploy built assemblies to\nuser specified location</li>\n<li>Ability to synchronize source code\nwith source-control system</li>\n<li>Version management capability</li>\n</ul>\n'}, {'answer_id': 16697147, 'author': 'John Rasch', 'author_id': 44765, 'author_profile': 'https://Stackoverflow.com/users/44765', 'pm_score': 1, 'selected': False, 'text': '<p>This is a common problem (and I wish I had read it sooner) for all development, not just ASP.NET. Being one of its developers, my team naturally uses <a href="http://inedo.com/buildmaster" rel="nofollow">BuildMaster</a> internally for the entire release process, and for most scenarios it\'s free. Within the tool, we are able to perform all the standard CI builds to create artifacts and then set up an automation process to deploy these artifacts to any one of the 40+ servers we have internally or externally hosted, depending on the specific application or environment.</p>\n\n<p>Since you specifically mentioned deployment to different testing environments, this is a fundamental aspect of the tool. The idea is to model the environment workflow (e.g. Integration -> QA -> Production) you already have in place and essentially promote a build all the way from source control to production. Most times, it\'s as simple as adding a deployment action that deploys an artifact to the environment, other times it can be much more complex.</p>\n\n<p>You also casually mentioned configuration file changes are part of deployment, which is another built-in component to BuildMaster. The idea we had was to use the tool itself as the central hub for all configuration files and deployments, thus ensuring the latest changes are applied automatically with a simple "deploy configuration files" action in your deployment plan.</p>\n\n<p>One thing you didn\'t mention with regard to this process is the database deployment aspect. Most ASP.NET applications require an associated database, otherwise they could just be static HTML files. It is crucial that the database schema gets updated to the appropriate database version with every deployment. There is, not surprisingly, a module within BuildMaster that handles this for you as well. The idea is to store DDL-DML scripts within the tool itself, and by executing scripts <em>only once</em> per environment, it ensures that all of your databases across each environment are up-to-date as your builds are deployed through them. Other scripts (e.g. stored procedures, views, triggers, etc.) are essentially code files and therefore belong in source control. These DROP-CREATE-CONFIGURE type scripts can be run each and every time in most cases with a simple deployment action.</p>\n\n<p>Another piece of the deployment puzzle that most developers do not think about is process automation. Many developers need to perform sign-offs or fill out change request forms in order to manually perform these processes. Again, this is all available as part of the automated workflow setup within BuildMaster. You can setup blockers that do not allow promotion to say the QA environment unless all unit tests have passed, or block promotion to the Staging environment unless someone from the QA team approves the build and all issues in your issue tracking tool are resolved/closed for that particular release.</p>\n\n<p>While I realize I left out CC.NET from the answer, our applications are all built and deployed through BuildMaster so we no longer need it, though we could however just as easily pickup the artifacts from a drop location and deploy them in later environments.</p>\n'}, {'answer_id': 17639173, 'author': 'Jonathan', 'author_id': 964102, 'author_profile': 'https://Stackoverflow.com/users/964102', 'pm_score': 1, 'selected': False, 'text': '<p>I see that many people use CC for their .NET projects, but why not use Jenkins, Sonarqube? They got all you need. I setup all this in 3 days. I have a Win 2008 server R2, MSSQL, Jenkins, VIsual SVN and Sonarqube.</p>\n\n<p>It all works great and u get all metrics on your project. Sonarqube uses Gallio, Gendarme, FXcop, Stylecop, NDepths and PartCover to get your metrics and all this is pretty straight forward since SonarQube do this automatically without much configuration.</p>\n\n<p>i post som pictures for u too get a feeling for it. Here is Jenkins witch builds and get Sonar metrics and a another job for deploying automatically to IIS</p>\n\n<p><img src="https://i.stack.imgur.com/VbAmP.png" alt=""></p>\n\n<p>And Sonarqube, all metrics for my project. This is a simple MVC4 app, but it works great!:</p>\n\n<p><img src="https://i.stack.imgur.com/0nKLI.png" alt=""></p>\n\n<p>If you want more information i can be more specific but i think you should at least consider jenkins. If CC suites you better, at least you looked at good alternative before you chose.</p>\n\n<p>This whole setup uses MSBuild, too build and deploy the apps.</p>\n'}]
['https://Stackoverflow.com/questions/57762', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5416/']