Pintle.Packager – Sitecore Package Generator

Have you ever developed a module for Sitecore? If you did, then you might have thought about ways of your module delivery.

The delivery method depends on your actual module implementation. If it is a simple developer tool which does not include any Sitecore items to be installed, then you can simply use Nuget feed. This will allow you to push updates and versionize your module out of the box.

But what if your tool does include Sitecore items? Or for example your target audience is not developers, but regular Sitecore editors/users which do not have access or knowledge about Nuget or any other developer tools. In this case you will have to deal with Sitecore Installation wizard.

The problem

Sitecore installation wizard is a native Sitecore tool which is being a part of the platform for many-many years. The wizard provides seamless and consistent way of installing new items and/or files into Sitecore instance as well as gives the UI for creating Sitecore installation packages.

It is very easy to create a Sitecore package using the Sitecore UI which is provided out of the box. But lets think about more advanced scenarios.
Let`s say you have a module which includes installation of 30 items in both core and master databases, and 20 files in different site locations.

In this scenario, we are facing several issues:

  • manual package assembly takes a lot of time and efforts
  • there is a big chance for a human error while doing the release version of the module package
  • if you keep developing your module, you will need to re-assemble installation packages multiple times for next versions which will require same efforts and there is still a room for human errors

So how can we solve that?

We were thinking that it would be nice to have a way to declare what is included into the package and then to have a tool which would generate the package by reading that declaration.
Therefore we came up with another developer tool – Sitecore Package Generator.

The main concept is that you are able to create a configuration for the package with metadata and declaration of what files and items it needs to include:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <pintle.packager>
      <packages>
        <package name="MyPackage" type="Pintle.Packager.Configuration.PackageConfiguration, Pintle.Packager">
          <metadata type="Pintle.Packager.Configuration.MetadataConfiguration, Pintle.Packager">
            <packageName>My package</packageName>
            <author>My company</author>
            <version>1.0.0</version>
            <publisher>My company</publisher>
            <license>@ 2019 My company</license>
            <readme>Readme about my package</readme>
            <comment>My package comments</comment>
            <packageId>MP001</packageId>
            <revision>001</revision>
          </metadata>
          <items hint="raw:AddItem">
            <item database="master" path="/sitecore/templates/Sample"/>
            <item database="master" path="/sitecore/layout/Renderings/Sample"/>
            <item database="master" path="/sitecore/system/Modules/My module" children="false"/>
          </items>
          <files hint="raw:AddFile"> 
            <file path="/default.css"/>
          </files>
        </package>
      </packages>
    </pintle.packager>
  </sitecore>
</configuration>

And then open {host}/sitecore/admin/packager.aspx and find your configuration in the UI. Using only one click on Generate package button will do all the work for you.

With having this tool, you can create a consisten workflow on how you keep developing your module (or just any installation package):

  • keep using unicorn and all your regular development tools for continious delivery of your project
  • include Pintle.Packager configs to your source control and continious delivery
  • test your tool on the actual Sitecore instance
  • generate valid installation package of tested version of your module or feature at any point of time.

Consider using this tool if

  • you need to regularly generate pre-defined packages
  • you need to automate package generation to eliminate human errors
  • you want to versionize installation packages depending of your functionality version

Installation

To install Pintle.Packager run next command in the Nuget Package Manager console on your Sitecore website project:

Install-Package Pintle.Packager

Compatibility

  • Built on Sitecore CMS 8.0 rev. 141212 (8.0 Initial Release)
  • Tested on all Sitecore CMS releases starting from 8.0 up to 9.2.
  • Supposed to work on lower Sitecore CMS versions as well as it uses native Sitecore API.

Documentation

The implementation of Pintle.Packager uses native Sitecore API for both packages configuration and their generation. The tool is fully configuration driven and introduces its own Sitecore pipeline which serves as an entry point for extensibility. This is an open-source project – find more documentation and the source code on our github Pintle.Packager

Share article
See also
Content migration sitecore

Sitecore content migration – a technical guide

Read more Volodymyr Hil 04.11.2019
Sitecore benefits in the AWS cloud

Sitecore to AWS Case: Cloud as a Transition

Read more Motiejus Bagdonas 21.10.2019

MVC renderings with xWrap framework – Sitecore Experience Wrapper

Read more Volodymyr Hil 10.12.2018

Introducing xWrap framework – Sitecore Experience Wrapper

Read more Volodymyr Hil 09.12.2018
pintle-at-sitecore-symposium

A recap from Sitecore Symposium 2018 and MVP summit

Read more Volodymyr Hil 25.10.2018