Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to build a sitecore data package from command line, or outside of a web context? i.e. using nant

The Sitecore package wizard can be used to build a package containing data and files for the local Sitecore instance.

Is it possible to build a Sitecore package (items only, files are not required) from the command line, or otherwise outside the context of a website? The idea is to use Nant to create a Sitecore data package. I'm aware of Hedgehog TDS, but this question is aimed at what can be done with the existing Sitecore api.

like image 427
Paul George Avatar asked Dec 07 '11 11:12

Paul George


3 Answers

You should take a look at the Sitecore.Install.PackageGenerator class in the Sitecore.Kernel to see how you may go about creating traditional Sitecore packages.

However, you are looking to do this outside of a website context. How do you plan on getting items into the package if you don't have access to the Sitecore web site in which they exist? Before you try to create a package on your CI server I would think you would need to get the Sitecore items into source control so that you can work with them.

I think you have two real options here.

  1. Roll your own solution, leveraging serialization APIs, for getting Sitecore items into source control and moving between environments
  2. Hedgehog Development's Team Development for Sitecore

For more information on Sitecore serialization please check out the Sitecore Serialization Guide. Specifically, check out how Sitecore envisions you use "Sitecore Serialization with a Source Control System"

Also, do some digging around for others who have rolled their own solution around serialization. For instance, http://mcore.wordpress.com/2009/03/17/sitecore-serialization-for-version-control/

like image 124
Sean Kearney Avatar answered Nov 09 '22 00:11

Sean Kearney


As skolima suggested... I've implemented and explained a solution using Sitecore Powershell Console here: http://blog.najmanowicz.com/2011/12/19/continuous-deployment-in-sitecore-with-powershell/

like image 31
Adam Najmanowicz Avatar answered Nov 08 '22 23:11

Adam Najmanowicz


The PowerShell Console for Sitecore could be possibly extended for such scenarios (or simply scripted).

like image 1
skolima Avatar answered Nov 09 '22 00:11

skolima