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

5

12

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.

Teenateenage answered 7/12, 2011 at 11:20 Comment(0)
X
5

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/

Xyloid answered 7/12, 2011 at 15:42 Comment(0)
C
3

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/

Cannice answered 19/12, 2011 at 12:29 Comment(0)
D
1

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

Dunton answered 8/12, 2011 at 14:26 Comment(1)
The powershell module now includes a "Build package" script i the context menu, so you can right click an item and create a package from that portion of the tree.Novelist
R
0

Check this link: http://www.webdatasource.com/2011/08/exporting-and-importing-packages-from-sitecore-through-code-using-sitecore-api/

It describes a solution of creating and installing Sitecore packages using the API.

Reremouse answered 8/12, 2011 at 14:18 Comment(1)
This code needs to work inside Sitecore - so no console tool could use it, unless you provide a way to connect to the Sitecore process from console.Dunton
Z
0

Check out Sitecore Courier Shared Source module. It compares two folders with serialized items and creates a diff package.

You can also browse the sources as an example of Sitecore.Update API usage.

Zing answered 20/3, 2013 at 19:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.