Can We Build It 1: Arguing With SIM

I’ll be honest – I love SIM (Sitecore Instance Manager). We develop a lot of module-type-gubbins and need to be able to quickly set-up and test in different versions of Sitecore so the ability to install, back-up and tear down different versions of Sitecore at the push of a button is incredibly useful.

With this in mind, I’ve recently been assessing our processes at Kumquat HQ and trying to streamline things. Make sure that we have a consistent way of setting up projects, reducing some of the leg work when projects are first created.

Here’s SIM in all its majesty:

sim-01

If we follow through the Install Instance command – we eventually get to this screen which always gets me very excited (and then I click past it):

sim-02

So I thought for this blog post – I’d unpack this bit because it’s fun (and it’ll become standard practice for new projects over here while I’m at it).

If we look in the Packages folder (which I found by clicking on “Add Package” because it wasn’t immediately obvious 😉 you’ll see “Visual Studio 2015 Website Project.zip” also has a manifest:

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

So the first thing which rankles – I don’t like the solution in the installation folder. I’d rather have it outside – so what I’ve been experimenting with lately is having all the code stuff in a parallel folder which I’m calling Code – so your folder stucture looks like:

/InstanceName/Code
/InstanceName/Data
/InstanceName/Website

If we also dig in to the .zip file – we see it looks like this:

sim-03

So our first challenge is to get this stuff in to a Code folder… I first tried just changing the “move” operation to point to /Code/ but that didn’t work. Boohoo!

Looking at the code for SIM – there’s no way to move a folder (only files) so I’ve customised the SIM code – adding the following option in ConfigurationActions.cs:

case "movefolder":
{
   var target = child.GetAttribute("target");
   var destPath = Path.Combine(instanceRootPath, target.TrimStart('/'));
   FileSystem.FileSystem.Local.Directory.Move(path, destPath);
   break;
}

This allows us to create a manifest which looks something like this:

 
 
 
 
 
 
 
 
 
 
 
 

So we can put whatever we want in a Code folder in our zip file and it will be extracted and then moved to the root folder giving us the folder structure we want. This Code folder can then be added to GIT (other lesser cool Source Control systems are available).

For the purposes of this blog I’ve just copied a zip with /Code/readme.txt in it. In the next blog post I’ll start on a package with a solution and project(s), nugety goodness and some starter code etc.

I’ll also discuss my change on my local SIM with the powers that be over at SIM central – see if there’s any way I can get involved and push this code in to the repo.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s