Project Description
SPDeploy is a SharePoint structured dev/test deployment and retraction utility by Einar Otto Stangvik.
http://www.CodeForNuts.com http://twitter.com/einaros

About

SPDeploy will, based on schema validated xml configuration, lookup or create content in a local SharePoint farm, such as WebApplications (with content database and iis site / application pool), Sites, Webs. It will also handle wsp solution installations to the farm; further deployments of installed wsps into web applications; activation of features on all feature-accepting levels of the structure.

Folder, list item and document support is planned, but not as a replacement for WSPs, features or plain common sense.

With SPDeploy you can quickly, and painlessly, reset and redeploy your test or development environment, as well as quickly add development / third party features to the mix - without incorporating them into your production ready wsps, or extending large powershell / batch scripts. The point is to encourage proper integration testing in your development environment, and bringing structure to your favorite SharePoint build server.

Important! Deployment or upgrades into a production or even UAT environments should be made with as strict a setup as possible, with (if possible) all the structure definition, creation and library deployment packaged into definitions, features and solutions. I do not suggest using SPDeploy for this. Test with SPDeploy - ship with wsps and upgradable features!

Essential Screen Casts

These are three screen casts I recorded just after uploading the first release, in which I attempt to explain my motivation for creating the tool, some info on the project and an example of it running. I recorded them with Jing, which limits me to 5 minutes for each one, hence the triplet. Have fun digesting my scandinenglish!

http://www.screencast.com/users/einaros/folders/Jing/media/b8ae263c-65ad-4986-bf8e-e005a0a71c63
http://www.screencast.com/users/einaros/folders/Jing/media/4c2b067a-6d17-4048-804a-87351e0550c2
http://www.screencast.com/users/einaros/folders/Jing/media/ca1d99d1-cd96-455c-b226-1c21157408cc

Developer / extension notes

All data classes in the project are generated from XSD, and generic configration runners make it easy to expand with custom sub nodes. Add an accepted sub node to the XSD, rebuild the project to generate new data classes, and create a Processor derived class to deal with the new sub node type. A new sub node processor will automatically get the result from the lookup or creation of the node above (like a SPWeb, if you're adding processors under the XML's Web node).

Sample xml configuration data

For a complete specification, check the SPDeploy.xsd file within the Schemas folder of the latest release.

One thing you'll notice below, which distinguishes itself from the other attributes, is "Action". The value is either "Create", "LookupOrCreate" or "Lookup", and the behavior is the same no matter which node (of those who support it) it's used on.

For installs, Create will make an instance of whatever target the node describes. Lookup will try to open an existing element on the SharePoint server, such as an existing web or site, then throw an error if it fails. LookupOrCreate will first try to lookup, and if that fails - create.

For uninstalls, Create will delete the target, while Lookup / LookupOrCreate will just lookup and pass it on to the target below. In case of an uninstall of a Site node with Action:Create below a WebApplication with Action:Lookup, the Site will be deleted, but the WebApplication won't. If the WebApplication node has Action:Create as well, this will be deleted - meaning the Site node will never be evaluated, as it has already been deleted by the webapp uninstall.

<?xml version="1.0" encoding="utf-8" ?>
<Deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Schemas\SPDeploy.xsd">
  <Solutions>
    <Solution FileName="C:\path\to\a\Solution.wsp"/>
  </Solutions>
  <WebApplications>
    <WebApplication Action="Lookup" Name="SharePoint - 80">
      <WebApplicationExtensions>
        <WebApplicationExtension Action="Create" AllowAnonymous ="false" UseNTLM="true" Port="95" SSLPort="400"
                 UseSSL="true" Name="IntraExtra" Zone="Extranet" AuthenticationMode="Forms" ClientIntegration="false"/>
      </WebApplicationExtensions>
      <SolutionDeployments>
        <SolutionDeployment Name="Solution.wsp"/>
      </SolutionDeployments>
      <Sites>
        <Site Action="Create" Url="/" Title="RootWeb" LCID="1044" Template="STS#1" OwnerLogin="somedomain\user">
          <RootWeb>
            <Features>
              <FeatureActivation Guid="fba9e8df-b758-4197-8768-169ef727d5bb" />
            </Features>
            <Webs>
              <Web Action="Create" Title="RecursionWeb" LCID="1044" Template="STS#1" Url="RecursionIsFun">
                <Webs>
                  <Web Action="Create" Title="RecursionWeb" LCID="1044" Template="STS#1" Url="RecursionIsFun">
                    <Webs>
                      <Web Action="Create" Title="RecursionWeb" LCID="1044" Template="STS#1" Url="RecursionIsFun">
                        <Webs>
                          <Web Action="Create" Title="RecursionWeb" LCID="1044" Template="STS#1" Url="RecursionIsFun">
                          </Web>
                        </Webs>
                      </Web>
                    </Webs>
                  </Web>
                </Webs>
              </Web>
            </Webs>
          </RootWeb>
        </Site>
      </Sites>
    </WebApplication>
    <WebApplication Action="Create" Name="TestApp" Header="vm-dev" Port="8009" Database="TestContent" PoolName="TestPooly" CreatePool="true">
      <SolutionDeployments>
        <SolutionDeployment Name="Solution.wsp"/>
      </SolutionDeployments>
      <Sites>
        <Site Action="Create" Url="/" Template="STS#1" LCID="1044" OwnerLogin="somedomain\user" Title="TestWeb">
          <RootWeb>
            <Webs>
              <Web Action="Create" Title="SubWeb" LCID="1044" Template="STS#1" Url="SubWebUrl">
                <Features>
                  <FeatureActivation Guid="fba9e8df-b758-4197-8768-169ef727d5bb" />
                </Features>
              </Web>
            </Webs>
          </RootWeb>
        </Site>
      </Sites>
    </WebApplication>
  </WebApplications>
</Deployment>



Last edited Oct 11, 2009 at 9:56 PM by einaros, version 11