none
TFS Build Automation and Deployment

    Question

  • I was wondering how to have TFS deploy our builds to different environments once an automated build is complete. For example, our solution includes a website project, database project, and database server project. When we check in code, we have a build definition with a CI trigger that builds the solution and puts the output in a drop location. That part is working great. Ideally, TFS could then go ahead and deploy the changes to our QA environment for review. The only trick is, the destination servers are only accessible to us via FTP. What's a good way to handle auto-deployment after the build in this scenario? (Sorry if I'm missing something obvious here)
    Wednesday, September 15, 2010 11:14 PM

All replies

  • In Visual Studio 2010 there is the solution you want and it is called MSDeploy: http://msdn.microsoft.com/en-us/library/dd394698.aspx
    Ewald - Please remember to mark the replies as answers if they help.

    Ewald Hofman
    Blog: www.ewaldhofman.nl
    Thursday, September 16, 2010 3:44 AM
  • Thanks Ewald, I've actually been doing quite a bit of research around that very tool (after I posted here). One question though, everything I read about MSDeploy seems to refer to it in the context of Web Application Projects. We have a Web Site project. Will we need to convert to a WAP to get it to work with MSDeploy in an automated fashion? 

    Also, this is a 2.0 site. Will the web.config transformations work with that, or do we have to upgrade it to 4.0 framework to get that capability?

    Friday, September 17, 2010 1:27 AM
  • Anyone care to elaborate on the above?

    I've looked into using the Web Deployment Project to create build output that is more MSBuild friendly, but so far have not gotten very far with that. 

    Tuesday, September 21, 2010 2:58 AM
  • We have been working on a similar problem jabell, and currently have 2 different solutions in the works.

    1.  We built a custom build template that will execute a cmd script upon a successful build completion.  This involved writing a custom workflow activity, and then inserting that activity into the build template xaml. You then use that custom build template in a new build definition.  This custom workflow activity .dll has to be published to the gac on both the TFS server, and your build box (if they are not the same) using the .net 4 version of the gacutil command.

    Kind of messy and roundabout, but it is currently how we are managing our deployments.

     

    2.  We have been experimenting with a tool called TFS Deployer (http://tfsdeployer.codeplex.com/wikipage?title=Introducting%20TFS%20Deployer&referringTitle=Home ) .  This allows you to change the build quality cause the service to automatically deploy to the desired location.  Currently we do not have this fully functional, but it seems promising.

     

    I have not used, nor know much about MSDeploy, so I can't comment to the usefulness of that tool.

    Thursday, September 30, 2010 3:41 PM
  • Thanks for the reply.

    From the research I've done, MSDeploy seems to be the preferred way ... although the examples and documentation are somewhat sketchy. It seems clear, though, that in order to do any kind of automated deployment we're going to have to change our project to be a WAP.

    Here are two videos that cover deployment scenarios in VS2010 that I found to be helpful:

    http://live.visitmix.com/MIX10/Sessions/FT14

    http://www.microsoftpdc.com/2009/FT56

    I'm working on converting our Web Site Project to a Web Application Project in a test branch ... once I get that completed, I'll be able to try some of these deployment techniques out. Stay tuned.

    Thursday, September 30, 2010 3:49 PM
  • Hi Jabell,

    Has there been any further development on your progress with this?  I'm currently in the same boat and trying to figure out our best solution.

    Our website (static files) is rather large and I'd like to keep it as a WebSite project rather than a WAP, but if I use the Web Deployment Project to wrap up the WSP I find that the /p=CreatePackageOnPublish doesn't work.

    Also, did you ever get an answer/solution about replacing the web.configs for the .NET 2.0 project?

    I agree...it looks like there aren't too many articles out there about deploying existing .NET 3.5 projects with VS 2010/TFS 2010.

    Thanks,

    Felix

    Wednesday, January 26, 2011 10:44 PM
  • No, I haven't made any more progress on this. :-( Would still love to find an answer though. I looked at Web Deployment Projects, but couldn't get them to work either. Besides that, it essentially compiles the whole project into a DLL, similar to the way a WAP does. So, why not just use a WAP?
    Thursday, January 27, 2011 10:03 PM
  • This particular website I'm trying to deploy (with TFS Build) is purely static pages and classic ASP pages.  If I use the Web Deployment project to wrap up the Web Site Project, I can't get the WDP to create a Deploy package when building with TFS.  However, I can get it to create a Deploy package from Visual Studio by right clicking and selecting "Build Deployment Package". 

    When I try to build the WDP in TFS and add the "/p:CreatePackageOnPublish=True", it doesn't seem to be creating me a Deploy package like it does with a WAP.

    Thursday, January 27, 2011 10:15 PM
  • I've found that when TFS does an automated build of our WSP it puts it in a folder called _PublishedWebsites. The output of this is the same as I get from the Web Deployment Project; it is all pre-compiled. I'm now looking into a way to just take the output from the drop location and push it over to our target servers via FTP (excluding web.config).
    Wednesday, May 25, 2011 2:21 PM
  • Jabell, why not use TFS deployer. http://geekswithblogs.net/TarunArora/archive/2011/05/21/tfs-deployerndash-automate-deployments.aspx This is a tool on code plex, that integrates with the build explorer. When you change the build quality on a build in your TFS build explorer, an event is raised that is captured by the tfs deployer service at this point it can execute your deployment script to deploy your solution on the QA environment.

     

    At our present client, we have automated deployments for web, database, ssrs reports in QA, UAT, production using TFS deployer. If you need any speciifc help around that, feel free to contact me.


    Walk_Man... Share the joy... 'Propose as Answer' if the post helps.

    Tuesday, June 07, 2011 7:56 PM
  • Jabell, why not use TFS deployer. http://geekswithblogs.net/TarunArora/archive/2011/05/21/tfs-deployerndash-automate-deployments.aspx This is a tool on code plex, that integrates with the build explorer. When you change the build quality on a build in your TFS build explorer, an event is raised that is captured by the tfs deployer service at this point it can execute your deployment script to deploy your solution on the QA environment.

     

    At our present client, we have automated deployments for web, database, ssrs reports in QA, UAT, production using TFS deployer. If you need any speciifc help around that, feel free to contact me.


    Walk_Man... Share the joy... 'Propose as Answer' if the post helps.
    Tuesday, June 07, 2011 7:58 PM
  • It is fairly easy to setup and configure automated deployment using TFS,
    http://codingcraft.wordpress.com/2012/02/18/automated-deployment-with-tfs/
    Sunday, February 19, 2012 6:59 AM
  • That's a great post, and a good reference on some of the optional parameters for the Build Process Template. However, we are using a Web Site project, and I haven't had any luck with those parameters on a Web Site Project with a deployment project. We have resorted to doing manualy deployments of the code base (7Zip the project, FTP, a decompress and copy files over).
    Sunday, February 19, 2012 5:42 PM