Category: Tools


I used to only use NAnt to copy dependencies around a project, due to me being familiar with it as well as Nant having many other useful features. However I wondered the other day whether there was anything more simple and quicker to set up than going the whole hog and using Nant. Reason being – I’ve found that I do a lot of smaller projects that don’t have the need for the lengthy Nant installation and setup.

I guess up until this point, I had never really looked in Visual Studio for this functionality. Any way, cutting to the chase:

Right click your main project that you want copying from, select properties. Then select the Build Events Tab. In the Pre-build event command line throw in something like below to get your copy going.

copy "$(ProjectDir)Web.config" "$(SolutionDir)Move.Tests\bin\Debug\Move.Tests.dll.config"

If you are unsure as to your options, click the Edit Pre-build button and hit the macro button. It will show you the tokenized values for common build properties such as $(ProjectDir).

I am going to talk about our Sitecore environment including the different servers involved, the process of building new functionality and fixing bugs. This post is the product of a lot of blood, sweat, tears + money. It hopefully might give you some direction in how to set up your environment. The project has gone from simple to complex, back to simple and probably ended up somewhere in between. Our set up is probably not in its final state yet as we have found that things don’t last long in our Agile environment. Constant tweaks here and there in aid of improvement.

To start with, we wanted a robust, tested system with as many regression tests as possible. To support this we chose to use continuous integration (CI). The annoying thing is that Sitecore and CI don’t really fit hand in glove. The main pain is the fact that a working environment is a mix of code and data. We found it nice and easy to add code into Subversion and for that code to be automatically checked out, built and tested on a CI box. However how do you handle data changes? For example you could delete a bunch of nodes in Sitecore and break the site, change the template types, change names, change permissions. How do you tie this in with the versioned code.

We decided that trying to directly tie data into the CI process would be super hard. You could have some event serialize the items in the tree and do something with them but we decided it was a time sink for the project.

Moving forward we have stuck with two real areas for testing for our CI, firstly using WatiN for the front end of the web site as well as unit testing and integration tests for core business logic.

Development Environment a.k.a. “Dev Dirty”

This is where the ball starts rolling. This is the developers local machine. The developers local machine is connected to a shared database, shared amongst the other developers. (Caveat – We try not to work on the same task at the same time as we find caching can cause an issue (usually resolved with an IE cache clear and IIS reset)).

We have 2 main branches in our Subversion repository. One called “current” which is the current code we are working on in our development environments and one called “test” for our test environment.

When we pull a feature task off the Scrum board, we would create a branch off the “current” and call it something like Feature – [Seb's New Feature]. This means I can go off and work on this new feature. When I am done with the code I create WatiN tests that test the frond end UI and any business logic testing. We use a Model View Presenter pattern to break open the larger/more complex stuff so that we can test it.

When I am done and happy, I will check this back into to my Feature – [Seb's New Feature] branch. I will then jump back on to the current branch and merge my feature back in. (I am told that this is the easiest way of doing it).

Cruise Control Environment

Upon me checking code back into the current branch, a seperate box running Cruise Control picks up on the fact that something in the code has changed in Subversion. It then runs a custom NAnt build file that pulls out the latest version of code from Subversion, compiles it, tests all our of Nunit and Watin tests and then alerts us to whether or not the build worked. You can at this point make it even more swanky and have it check code coverage (NCover), quality of the code (FXCop) etc…

Development Environment a.k.a. “Dev Clean”

We have experimented with pushing information between environments via packages as well as full blown system publishes (add the destination as a publishing target and it will overwrite it for you). We are currently trying to stick to piecemeal packages for each task/bug we work on. We can then commit those into Subversion under our branch so we can see which code was related to which piece of Sitecore Data.

To give an example, say I changed 2 templates in Sitecore as part of a new feature, I would create a package containing them, and save it under a folder called “Uninstalled Packages” under my feature branch.

This process gives us the ability to logically group and version code + data.

Any way back on track – The Development environment is the next environment upstream of our Local development machines. It is still a development environment, however this is the make or break point to test to see whether our packages work.

We will do an update on the codebase using subversion behind the scenes and install the package using the package installer in Sitecore. If it doesn’t work we go back and re-create the package. Repeat until it works, and re-commit to Subversion.

We are now ready to push onto a Quality Assurance testing environment. The environments upstream of Dev will be covered over the next posts :) Tune back in for more.

UPDATED – 22/05/09: Added Reflector

Beyond Compare

Picture of Beyond Compare

Website: Beyond Compare
What it is: A file diff tool.

Beyond Compare is probably my favourite day to day tool and has given me an astonishing reduction in breakages when deploying code across systems. There are other free diff tools out there, however after evaluating most of them this is my favourite due to its intuitive design, colourful, easy to distinguish interface.

There is a small cost for the software but I think it is worth it.

See also: (Free) WinMerge

Notepad++

Picture of Notepad++

Website: Notepad++
What it is: A free text/source code editor

I like Notepad++ because it is the complete opposite to most of the IDE’s and editors that I use, in that the application is not sucking up all of your RAM and grinding to a halt, when I quickly want to modify a text or HTML file. It makes a nice alternative to the usual Windows Notepad application as it has syntax highlighting for example and useful features such as regular expression based finds. I’ve recently taken to using Notepad++ for a recent PHP client project.

Color Pic

Picture of Notepad++

Website: Color Pic
What it is: A free colour picker, and palette

How many times have you needed to open Photoshop to get at the colour picker tool? For me – lots. I found this program helpful as, again, it does not gobble up RAM like Photoshop and is useful for storing a palette of colours indefinitely. I use this tool a lot for finding out what colour something is on a page or for Web Development work.

FreeMind

Picture of Notepad++

Website: FreeMind
What it is: An open source Mind Mapping software

I find it very useful at a begging of a personal project to brainstorm everything I want to see in an application. It often becomes quite hard to document and visualize due to the excess of information. Mind Maps can be a really good canvas to paint your ideas on to.

I love how fluid the interaction with this application is. You can draft personalized maps very quickly and relatively intuitively. You can also save them in pdf or image format so others can read.

It’s not something you use lots but can really help when starting off on a project.

Subversion & Tortoise SVN

Picture of Notepad++

Website: Subversion, Tortoise SVN
What it is: Version control

I’ve used 3 version control systems in my life and this is my favourite by far. In fact when I look back to the days of Visual Source Safe – I shudder, it was that bad. I like Subversion because of its really well thought out logic and relatively low learning curve.

Subversion itself is the version control system, which comes with natively with a command line interface. I, like many people also install Tortoise SVN which integrates into windows so you can see the state of each file. Version control then becomes a right click, command operation. Easy!

See also: My article on free Subversion hosting

Firefox & Firebug

Picture of Firebug

Website: Firefox, FireBug
What it is: A tool for analysing web page structure, CSS and Javascript debugging

Firebug is a MUST HAVE for web development. Firebug is a Firefox plugin that allows you to visually inspect the web page you are looking at. You can look through the DOM, inspect elements, change HTML and CSS on the fly, watch HTTP headers and debug Javascript. It makes website debugging a lot easier having all these powerful tools in one place. It also saves you having to make changes to your underlying code, building and then refreshing.

7-Zip

Picture of 7-zip

Website: 7-Zip
What it is: A file compression + extraction tool

Throw away WinZip and WinRar and replace with this open source solution.

IIS Admin

Picture of IIS Admin

Website: IIS Admin
What it is: A tool for Windows 2000/XP that allows you to create multiple sites under IIS

I still use this tool a lot as it allows me to create multiple seperate website entities in IIS. This tool is not useful for any one using IIS 7 as it comes natively with this missing functionality.

Twihrl

Picture of Beyond Compare

Website: Twihrl, Twitter
What it is: Twihrl is a client for Twitter, based upon the Adobe Air platform. In case you are behind the times and don’t know what Twitter is – it is a social networking platform where users can post short messages or statuses. A bit like Facebook’s status message.

Why do I think it is a useful tool? Purely because it is a good educational/information tool. If you subscribe to people that “Tweet” (updating of their message), you can passively learn useful information.

Reflector

Website: Reflector
What it is: Reflector is a tool that will disassemble an assembly so that you can read through the source code (as long as it is not obfuscated). I use it a lot for looking through third party code, or perhaps an old .dll that I may have built, but lost the source code for.

Free hosted Subversion

I was recently looking for some free Subversion hosting when I stumbled upon Unfuddle http://unfuddle.com/.

It is a great FREE service that offers Subversion and Bug Tracking. The free account comes with 200MB of storage, one user account and the ability to have 1 active project. It works great for me being a single developer and I manage to get past the issue of being capped at one project max by using branches. I’m pretty sure I’ll burn up that 200MB space quick enough mind you.

Oh – you can also browse your repository via the web and get updates on changes to the repository.

Follow

Get every new post delivered to your Inbox.