DNN Blog

Jan 30

Posted by: Jon Henning
1/30/2009  RssIcon

I figured it may help some people to share my experience with getting my two projects (DotNetNuke ClientAPI and DotNetNuke WebControls) up on CodePlex and allowing them to be do automatic nightly builds.  The one thing I want to make clear before I start is that this is just one of many ways to do it. 

In order to successfully get nightly builds to work you need to put quite a few pieces of a puzzle together.

  • Setting Up Project On CodePlex
  • Source Control
  • Build Script
  • Versioning / Labeling
  • Packaging
  • Deployment
  • Triggering Build on Build Server

 

This blog will focus on the first two

Setting Up Project On CodePlex

This part is fairly well documented.  This page is a good place to start.  The restrictions on what type of projects can be hosted are found on that page.

Source Control

This one is both simple and hard at the same time.  Its simple due to the fact that CodePlex offers the goodness of TFS to host your source code for you.  Its difficulty lies in which client you choose to both push and pull your source code to the server.

When you click on any CodePlex project's Source Code tab you will be presented with 4 options:

  • Visual Studio Team Explorer:  The Visual Studio Team Explorer client provides access to Team Foundation Server from within Visual Studio. For information on installing the client and connecting to the Team Foundation Server please read the Visual Studio Team Explorer wiki page. You will need the information on the right to add the Team Foundation Server in your Visual Studio Team Explorer.
  • Teamprise Explorer:  Teamprise Explorer is a cross-platform Team Foundation Server client written by the folks at Teamprise. Teamprise is offering a complimentary license for anyone wanting to use Teamprise to connect to CodePlex. For information on obtaining the client and connecting to the Team Foundation Server please read the Teamprise Explorer wiki page. You will need the information on the right to connect to the Team Foundation Server in Teamprise Explorer.
  • CodePlex Client: The CodePlex Client provides access to the Team Foundation Server using an edit-merge-commit style of source control access. For more information on the client please visit the CodePlex Client project. You will need the information on the right the first time you connect to CodePlex with the client.
  • Subversion:  There are many Subversion clients available that can be used with CodePlex. TortoiseSVN is a popular Subversion client that works as an extension in Windows Explorer. For more information please see Using TortoiseSVN with CodePlex.

My original thought was to use what Microsoft provided.  So I started with the Visual Studio Team Explorer.  The problem was when I clicked on the link I was presented with this warning.

!! Warning !! - If you use the Team Explorer client then it will add source control binding information into your project files. When users download your source code and try to open it in Visual Studio they will get error messages because of the source control bindings. You can use any of the other available source control clients as an alternative.

Having your users open up your project and the first thing they are presented with is an error dialog.  Not cool.  This one was ruled out.

Looking at teamprise and realizing it was a 3rd party product that required licence fees caused me to shy away from this option.  Yes, I know, they state they offer a free licence to CodePlex users.   Something about how this offer is only advertised on a blog post from early 2007 mentioning beer turned me off... go figure.

Next I looked at the CodePlex Client.  First thing I notice here is another "warning".

The CodePlex Client is not currently being maintained. The focus of the CodePlex team now is on the SvnBridge project (based on overwhelming user feedback).

Hmm.  What is this SVNBridge.  Having worked on an Agile project for over a year, I am somewhat familiar with SubVersion, so I know that is what SVN stood for.  Its project page stated

SvnBridge allows you to use TortoiseSVN and other Subversion clients with Team Foundation Server. It converts the calls made by your Subversion client to the API supported by TFS.

So it looks like you need to run this bridge locally for TortoiseSVN to talk to TFS.  Ok...  I can manage that... but wait!

Note: You don't need to download SvnBridge to use Subversion clients with CodePlex. Every CodePlex project automatically has a Subversion URL (e.g. https://svnbridge.svn.codeplex.com/svn).

Uh, ok.  So apparently I don't need this SvnBridge to use TortoiseSVN.  So we are now left with Subversion.  Specifically TortoiseSVN.

If your reading this far you may already want to give up...  I don't blame you.  You chose to be a developer on the Microsoft platform because using their toolsets are generally easy.  This seems far from easy.  And if you are not familiar with setting up a SVN project you may be thinking that you want to throw in the towel.  But don't just yet.  Let me say that once you set up your project in SVN, using it is as easy as using Windows Explorer.

So what you need to do is generally follow the steps outlined on the CodePlex SVN Help page.

  • If you do not already have TortoiseSVN installed, you can download it here: http://tortoisesvn.net/downloads
  • Go to the Source Control tab of your CodePlex project and make a note of the "Subversion URL"
  • Open Windows Explorer
  • Create a new folder where you want to be your working directory for your source code.  If that directory already has code in it, you should not use it.  Rename it or pick a different name.  The folder needs to be empty.  Yes, I know this doesn't make sense to me either.   
  • Right click on the new folder and select "SVN Checkout...".  Yes.  TortoiseSVN integrates directly into Windows Explorer.  It adds context menu items and eventually you will see that it even paints pretty pictures on your folders letting you know that you have up-to-date or pending file changesIf you are like me you may be thinking why would I ever choose Checkout now?  We don't have and files in the folder and we haven't hooked it up to any source control. Why does Checkout equate to Create Project?  Just do it!
  • In the "URL of repository" field enter the Subversion URL. Example: https://svnbridge.svn.codeplex.com/svn
  • Click OK on the SVN Checkout screen.  You will then notice that the once empty folder now contains a new folder called .svn.  This is how subversion works, there is no local database, it uses the file system to store its meta-data.  Don't delete these folders!
  • The next step is to copy your source code into the folder.
  • Finally, right click on the folder and choose SVN Commit.  You will then be presented with a somewhat familiar dialog, allowing you to associate comments to your change set.  You can also choose which files you wish to include in source control.  IMPORTANT NOTE:  You may notice that you can exclude certain files by right-clicking it, you can even choose to exclude with wild-cards (obj*).  Don't do this yet, it won't work (most of the time) and you will just get frustrated.  First you need to check in your files, then once your done, the next time you check-in you can do you exclusions so those files will no longer show up in the list.  I think this has to do with the meta-data (.svn folders) not being present in the sub-folders, though am not sure.
  • Thats it.  Now simply modify the files at your leisure and check-in the changes with explorer.  You can check to see that the files uploaded successfully by going to the Source Control tab of your project page.

     

    The next entry in this series will dive into a little detail of how I chose to version and package my code with my build script.

  • Tags:
    Categories:

    3 comment(s) so far...


    Gravatar

    Re: Getting Continuous Integration Working With CodePlex: Part I

    Jon,

    If you are using subversion for your .NET projects, you will love the Visual Studio plugin AnkhSVN (ankhsvn.open.collab.net/). It completely integrates with both Visual Studio 2008 & 2005's version control provider model. You can check in, out, merge, directly from VS just like you would with Team System.

    VisualSVN is a licences alternative (www.visualsvn.com/), TortoiseSVN is a prerequisite for this plugin.

    Regards,

    Steve

    By Steven Pardo on   1/30/2009
    Gravatar

    Re: Getting Continuous Integration Working With CodePlex: Part I

    Steve, my concern would be that it would add project bindings in the same manner as the Visual Studio Team Explorer. Is this not the case with this product?

    By Jon Henning on   1/30/2009
    Gravatar

    Re: Getting Continuous Integration Working With CodePlex: Part I

    Hey - sorry that my blog post turned you off from getting a complimentary Teamprise license to talk to CodePlex. The Teamprise offer is available directly from the Teamprise.com homepage (Partners, CodePlex). I'll also see about adjusting the CodePlex wiki to provide more information there.

    That said, our stuff is really designed for folks wanting to contribute to CodePlex from inside Eclipse or from non-Microsoft operating systems. For people in Visual Studio on Windows wanting to talk to CodePlex I'd recommend that they use the (free) Team Explorer from Microsoft which adds TFS capabilities to Visual Studio or use the SVNBridge stuff that you highlight if all you want access to is version control.

    Anyway - good look with the migration to CodePlex. Give me a shout if there is anything I can do to help. You guys having a meet-up at the MVP Summit again this year? If so I'll hopefully see you there.

    Cheers,

    Martin.

    By Martin Woodward on   1/31/2009
    Attend A Webinar
    Free Demo Site
    Download DotNetNuke Professional Edition Trial
    Have Someone Contact Me
    Have Someone Contact Me
    DotNetNuke Store

    Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

    Advertisers

    r2integrated
    Telerik JustCode Free
    DotNetNuke DNN Hosting

    Sponsors

    DotNetNuke Corporation

    DotNetNuke Corp. is the steward of the DotNetNuke open source project, the most widely adopted Web Content Management Platform for building web sites and web applications on Microsoft. Organizations use DotNetNuke to quickly develop and deploy interactive and dynamic web sites, intranets, extranets and web applications. The DotNetNuke platform is available in a free Community and subscription-based Professional and Enterprise Editions with an Elite Support option. DotNetNuke Corp. also operates the DotNetNuke Store where users purchase third party apps for the platform.