Continuous Integration

PlasticSCM – Just Don’t
If you’re considering this source control tool.  Stop.  If you’re considering this for your development team, have mercy on them and [...]
TeamCity – Sharing Build Properties
Sharing parameters and properties can be a bit confusing for new users of TeamCity.  Lets use a simple example to illustrate how you can do this. For sake [...]
Xamarin iOS TeamCity Build
So this turned into a complete nightmare for a while. TeamCity Mac Agent Push Installation I started by trying to get TeamCity to do a push install of a [...]

Over the years I’ve used many source control systems.  Most of them seemed pretty simple to use after a short period of time.  However they all have their idiosyncrasies that will occasionally catch you out and some of them have been next to useless at their intended purpose.

The worst of these systems I have had personal experience with was Visual SourceSafe from Microsoft, this shouldn’t be used by anyone, ever.  I’ve seen it do the only thing a source control system should never do – lose your work.  I must admit that all my experiences with Microsoft solutions for this particular task have been poor.  I’ve only had TFS inflicted on me once and that experience was extremely lumpy and I really never want to have it again.  Certainly after reading that at the core of TFS is a re-written Visual Source Safe, shudder.

There are many source control systems to choose from which can make it a bewildering decision to make.  They range in price from free to eye-wateringly expensive for “corporate solutions”.  Source control is source control, it either does it or it doesn’t, you can keep your bells and whistles thank you!  I haven’t had the opportunity to try any of those since I haven’t worked for a massive organisation that was ever prepared to spend that kind of cash – yes they really can be THAT expensive, think six figure sums of cold hard cash, just on source control.  Your product has to be worth millions before you’d even consider them.

Subversion Source Control

For the most time, including my home projects and business source control tasks I have been using Subversion, particularly SVNServer and TortoiseSVN.  Since these projects are a one developer affair the extra functionality of a distributed architecture for collaboration was never a consideration and since I was also already very familiar with the system this was a no-brainer decision.  Install, setup a repository, get on with code.

To be honest SVN still isn’t a terrible choice (unless your name is Linus then you are stupid and ugly by default).  It does the job, it doesn’t get in my way (that often) and since everything is local to my machine it also performs well.  As soon as you have to start going over the network the performance can degrade dramatically though.

Enter Git Source Control

So last year (yes I know I’m very late to the party) I had my first commercial requirement to use Git and I also started using GitHub to host some of my own projects related to my Prism articles (part1, part2) and other bits and bobs.  I think one of the reasons that I had at that point kept Git at arms length was that I hadn’t been given a compelling reason to NOT carry on using Subversion.  I also hadn’t been given a commercial reason to NEED to use Git, I was already busy enough writing code to start changing core elements of my workflow.

Another issue was that during my first commercial use of Git, when I hit an issue the guys who owned the repository also didn’t know how to solve the issues which wasn’t very reassuring.  That just put a flag up for me hammering home that “Git was inherently complicated” – avoid.  I had also struggled to get some of my own stuff up onto GitHub using their own Git client application (which I now don’t use as I don’t think it’s very good to be honest).

There was no denying the rise and rise of GitHub as a platform and the fact that all my fellow developers seemed to be flocking to Git and loving it.  The final straw that led to this blog post was that I really wanted to help out on some open source projects – chiefly MvvmCross.

Now I had to learn Git and boy am I glad I did.

From the initial confusion, which is absolutely related to the way you think about source control and the choice of verbs like Add, Commit and Branch (among others), is that Git thinks very differently about these verbs.  It also does very different things in response to them on the command line.  BUT once you get it, you’ll realise the shortcomings of all the source control systems you’ve used before.

Git solves problems you didn’t even know you had.

The biggest difference that WILL confuse you is going from a traditional centralised repository model to Gits distributed model.  Don’t assume you will just get this fact, I thought I would, I didn’t, it hurt.  The best graphic I’ve seen that encapsulates this is …

source control git distributed model

Gits distributed model

The basic gist of this is that there is no one master repository that you are used to interacting with.  There are many but most importantly you have both a local “working copy” and a “local master repository” or “staging area” which you commit to.  You can link to an arbitrary number of “remotes” (other repositories) and push and pull from any of them as if they were all master repositories (in centralised parlance).  It couldn’t be more different from something like Subversion.

In the graphic above the origin can be thought of as a traditional central repository but you can have lots of these if you want.  More importantly you can also pull changes from anyone else and they can pull (update in SVN terms) from you.  All very cool, and very powerful.

Switching to Git Source Control

To get started with Git you first need to install Git itself (none of the gui downloads include Git).  A good GUI client (none of them are perfect) is SourceTree from Atlassian.  They also provide great resources here.  There is also a completely free Pro Git book.

I’m not going to go into any more details about that here as this is what the videos and links are for.  All these resources and the main video above will give you some context on Git.  Once you’ve watched that video this is the next one you should watch to get to grips with the nuts and bolts of Git.

Source Control – Learning Git
Package Dependencies & Deploying .NET
I recently had a requirement to completely package up a .NET application so that it was extremely portable beyond it’s initial installation. By [...]
TeamCity Backup Location Outside TeamCity Data Directory
By default TeamCity doesn’t allow you to place backup files outside the default data directory (internally known as the TeamCityData).  If you want [...]
Xamarin Android Automated CI Publishing Using MSBuild & JetBrains TeamCity
I love automating processes and making things consistently repeatable.  Continuous integration is your friend, yes it can take time to setup but if you [...]
TeamCity CI Server Login Fails at Boot Up
If you’re running an instance of TeamCity on your local dev box, and who isn’t eh! haha, oh for more machines.  It’s highly likely that [...]
Restoring YouTrack Backups
I love JetBrains software, I really do.  How I’d get by without ReSharper is anyone’s guess but they are not issue free by any stretch.  There [...]
Nuget Strikes Again
Honestly, for tool that’s supposed to make life easier and more robust I find myself battling with it often. I’ve been upgrading some of the [...]
CI Process – Why?
Why is having a CI process good? There are so many reasons why CI is good. I use it on everything I do. For my recent web based project it’s simple a [...]
MVC Deployment – JavaScript – ReferenceError is not defined …
This had me stumped for a moment. All the Javascript was there (linkable from bundle links in the page source), all the files were there, everything worked [...]
Build Process – TeamCity, NUnit, dotCover & Octopus Deploy
I’ve blogged about TC a bit in the past but I’ve just setup a whole new build process for my current project. Added into the mix these days is [...]
Batch Files Really Are Your Friends … Svn Backups
Just finished a long coding session … ??? BACK IT UP! set SvnAdminPath=C:Program Files (x86)VisualSVN Serverbinsvnadmin.exe [...]
Subversion Global Ignore Pattern
I’m slowly building up this default Subversion global ignore pattern for my Windows & Xamarin Development on Windows & OSX.  Nothing too [...]
MSBuild, TeamCity & Versioning
I have only recently start using TeamCity at home for my own major project SampleSort.  It is a pretty complex application all in all and the build process [...]
NCover MSBuild Task
After having configured my MSBuild scripts for use in TeamCity I found this rather nifty page in the NCoverExplorer UI.  You basically configure the NCover [...]
MSBuild – Editing Xml Scripts
Editing MSBuild Xml files can be a bit of a chore. For general everyday file editing I tend to use NotePad++ which is an awesome file editor and viewer. [...]
CI – TeamCity
I have finally completed the set-up and configuration of my new continuous integration system for SampleSort.  I have to say that I’m seriously [...]
Continuous Integration – TeamCity
Over the last 6 months I have tried a few CI systems for my own projects. I’ve been looking for something that will formalise the “Clean, Build, Test & [...]