Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Is it possible to achieve Continuous Delivery using TFS e.g. Windows Service? There are > 1000 posts on how to use msdeploy with TFS for WEB projects.

I am trying to understand why there are no resources such as blogs, articles, msdn or best practises for Continuous Delivery for Windows service using TFS.

I am not sure tow to achieve the following without any working reference materials. This is so frustrating.

  1. Archive existing codebase on Remote server for Service as well for Web project not on Integration Server please!

  2. How To Stop services on Remote server not on Integration Server

  3. Copy New code Base on Remote Server

  4. Start Services

share|improve this question
    
Do you use or looked at Continuous Delivery frame works like uDeploy, Puppet or Go? I know udeploy uses a client on the the deployment machine that can be scripted to do all that. –  mangelo Nov 22 '12 at 15:54
    
No i have not tried them. I am under impression that using TFS Powershell msdeploy msbuild thsi should be possible? –  swapneel Nov 22 '12 at 16:14
    
Strictly speaking using tfs powershell msdeploy and msbuild it is possible, if all your security permissions are set correctly and the fully scripted and the system you have have all the necessary parts. You need to do quite a bit to get it to work though, It took one of my co-workers 2 months to get a new product to auto deploy with a similar tool set. You need to look at this as a development project and set goals and workflow. –  mangelo Nov 22 '12 at 20:11
    
Do you know what references he used to get it working? As you have suggested willing to spend time of 2months not sure where to look for.. feeling like shooting in dark –  swapneel Nov 23 '12 at 9:00
1  
We use MSDeploy and the VS2012 build process to automatically generate parametrized deployment packages - works beautifully once you manage to wrangle it. The trick it to customize the Web Publishing Pipeline using an MSBuild target file in the project. Still working on the continuous delivery side of things. Leaning towards Powershell scripts that are checked in to the source code and used for production deployments. Either going to go the custom Build Workflow approach or a lightweight server that watches for new builds. Don't use MSBuild to deploy - it will happen before your tests run! –  ShadowChaser Feb 19 '13 at 6:04
show 1 more comment

3 Answers

Msdeploy is the worst thing you'll ever to do to yourself. It is very very hard to get the IIS versions and configurations right for it to work as expected. I would definitely use something like 7-zip to zip the code and xcopy to copy it and of course powershell to remote to the box. You can then manage IIS using powershell commands. You could also try alternatives like albacore if you don't mind learning ruby (in my opinion, ruby is way better and object oriented than powershell is)

share|improve this answer
    
Thanks. Yes i gave up on msbuild. At this moment I am using Poweshell scripts. Can you direct me to Ruby blogs/articles which will guide me on continuous Deployment. –  swapneel Dec 13 '12 at 9:27
    
You can look at code-magazine.com/Article.aspx?QuickID=1006101 which I ultimately got from this stackoverflow discussion stackoverflow.com/questions/487671/rake-for-net –  uttamkini Dec 13 '12 at 17:01
    
Going to disagree here, Msdeploy is downright amazing. Using VS2012 the WPP will generate a parametrized package complete with sample deployment scripts. We create parameter files for each environment - dev, qa, prod, and deploy our applications that way. MSDeploy is also used to synchronize each server in the web farm. Much better than rolling your own - the trick with MSDeploy is to create the initial website in IIS and deploy and update into that. –  ShadowChaser Feb 19 '13 at 6:07
add comment

It looks like there's a gap in continuous delivery and deployment.. But there are some tools that are really powerful and can fill in the gap!

I had the same problem a while ago and I found an amazing tool that saved my life, and everyones in my company that had to deploy manually our solution -every release- to all our customers. This tool is called Octopus Deploy.

In their Website they describe the product as:

Octopus Deploy is a user-friendly release management system for professional .NET developers. It enables automated, frequent, low-risk releases of ASP.NET applications and Windows Services into development, test, staging and production environments.

And it really does very well. This is the way we set it up in my company: We have a Git repository divided in three branches: dev-pre-pro.

As a continuous integration tool we use Hudson. Everytime Hudson compiles any of the three branches, it generates a Nuget Package (using OctoPack + MSBuild).

This packages can be consumed from our OctopusDeploy Administration site inside our domain. OctopusDeploy basically pushes nuget packages to its "tentacles" (services installed in the machines where we want to deploy) and performs custom actions using PowerShell.

This way, using PS scripts you can copy your brand-new-just-compiled-solution to the selected environment, start/stop services before or after copying or even update your Database. Just let your imagination flow..

So after we compile the project in the CI tool (it could be done using TFS) we can go to OctopusDeploy's administration site and perform an update to any of our environments (dev-pre-pro) with just two clicks!

Ps.- I don't work for OD, but I think it's an amazing tool! ;)

share|improve this answer
add comment

I decided to ignore msdeploy altogether. Largely for the same reasons you mention. Lack of documentation and noone seems to be using it (successfully).

My impression is that it only makes something that is not that hard complicated.

I stick with simple xcopy deploy methods. Most services like IIS have fine management interfaces, I just script against those.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.