NCIM Sitecore Team

Just another site

Continuous Integration in Sitecore

leave a comment »

Basically this post is a recap of the “Sitecore and Continuous Integration” webinar, perhaps with some extra details about some subjects.

The goal of continuous integration is to push every little piece of new software to next environments, the last step being production. Along this way, you want your software to be merged, compiled and tested.

This way of developing has been around for a while with standard ASP .NET software. The problem with Sitecore is that it also heavily relies on the database to function. Source control of the database is possible, but can be a deviant complex task. Some guys at Hedgehog developed TDS, a licensed solution for all your Sitecore collaboration problems. This isn’t an option for everyone however, and you maybe want a more simple cost-free solution.

Typical Sitecore development environment with multiple developer machines, development and version control servers and the published site.

Make sure you install Sitecore Rocks before you continue. Watch Pieter Brinkmans webinar if you never heard of Sitecore Rocks before.

VS Project structure

You want your project to be easily shared and deployed between developers. Here are some tips:

  1. Every developer has his own “dirty dev” web, master and core database, best not to use a shared database for development, as you will get in each others way.
  2. Create a different folder for your Sitecore libraries and let VS copy them to the bin folder on each build.
  3. Use a App_Data folder in your VS solution for your Sitecore data folder. Make sure you give this folder the required rights! More on ASP.NET folder structure can be read here
  4. In your web.config file, set a relative reference to App_Data in your datafolder variable.
  5. Make separate config files for each environment you are going to use.
  6. Also make separate ConnectionString.config files, unless you use the same settings on each environment.
  7. (Optional) You may want to consider removing the Sitecore shell from the project, depending on how badly you want use it in your development environment. Also, source control systems aren’t comfortable with large volumes of files. If you do decide to remove it, make shure you leave the Sitecore Rocks webservice intact.
Serialization of items in Sitecore Rocks

Serialization of items in Sitecore Rocks

Sitecore Item Version Control

First, make sure you have a folder called “serialization” in your App_Data folder. This is the folder where our Sitecore items are put into text files.

Committing items

Use Sitecore Rocks to serialize the items you want to share. To do this, right-click the node of the tree and go to Tools/Serialization/Serialize Tree. Do not put the entire Sitecore tree in there, just the necessary like templates, content and media. Now that you have the files on disk, you can commit them to the rest of the team.

Updating items

Synchronize your serialization folder and perhaps the rest of the project. Now just click one of the Update options in the serialization menu and voila, your items are updated!

Automated Building and Testing

This is something that depends on your own preference, methods and project conditions. The idea is to have a different environment with a Sitecore Instance(with shell perhaps) that checks out the latest version of the application of the source control server. The application is then build and tested if you have unit testing. Some options for these are:

There is also this interesting article about Sitecore Unit testing without an HTTP Context.


I personally use Microsoft Web Deploy to do this. You can deploy directly from Visual Studio as well as a build server. I used this article to set everything up.

Setting up continuous integration for Sitecore can take some time to perfect, but you will find it very productive once all the little daily frustrations are gone, making time to concentrate on building better websites.


Written by lucasbol

June 29, 2012 at 11:06 am

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: