March 29, 2018 | Sean Holmesby
Development of features and components requires a set of Sitecore items to be packaged - things like renderings and templates. Sitecore packages simplify the complex task of deploying changes to multiple environments in a consistent and repeatable way, lowering the cost of development and increasing reliability. With TDS Classic, Sitecore developers can automate the packaging process.
Types of Sitecore packages
.zip packages - created through the Sitecore package designer. These can include both items and/or files and can be built in several different ways. More information on those can be found here.
.update packages - a different style/type of package. They too can include both items and/or files. These types of packages were created by Sitecore to handle product and module upgrades, and are usually installed via the /admin/UpdateInstallationWizard.aspx utility page.
TDS Classic is one of the few tools available that lets users generate .update packages in a straightforward fashion. This type of package is often used in SDLC processes to roll out new features into QA and Production environments.
Packaging 101
TDS Classic has an ‘Update Packages’ tab where developers can turn on package creation for a build.
This means that Sitecore-standard update packages will be created during build time, and developers can choose to use it to:
- contain both compiled code and items
- create separate packages, one for code and one for items
- create an items-only package.
These variations allow developers to customize their own deployments. If, for example, a deployment is setup for CD servers, and only the code is needed, this can be achieved. In that case the user would only need the code in the package (as items are published to the web database through Sitecore anyway).
Alternatively, if a user has another way to deploy the code to their CMS (like through MSDeploy, FTP, or xcopy), and they only need the update package to contain the Sitecore items, and not code, this can also be achieved with the items-only package option.
Switching on this function, and selecting these options, are all on the simple properties page.
Bundling multiple projects so you only have a single package to deal with
TDS Classic allows Sitecore developers to automate the packaging process. In the ‘Package Bundling’ section, users can select the other TDS Classic projects they want included in the Update Package they are generating and only need to manage one file for the entire solution’s build, instead of a package for each project. The projects that you want to bundle are selectable from the Multi-Project Properties page.
Excluding Items From A Package
If a user builds with different solution configurations (i.e. one configuration for QA, one for Staging, one for Production) they can exclude items from the package using either the Deployment Property Manager or by the Visual Studio Property Window.
Select the items you don’t want to be include in the project, and in the ‘Exclude from Configuration’ box, check the configurations you don’t want them in. Then update packages won’t include them items in the deployment.
Delta Packages
Packages can be ‘shrunk’ down even further by telling TDS Classic in the build to ‘exclude items changed after’ a certain date. This is good for removing items known to have been previously pushed from the current package, shrinking down the package contents, and saving a lot of deployment time.
On the General tab, the ‘Exclude Items Changed After’ setting controls this (based off the __Updated field for items.) This is extensible, so users can even write their own logic about how items should be culled from the project. If using Git, the open source GitDeltaDeploy module can be used. This culls items based on a ‘git diff’ from your previous deployment.
Custom Post Deploy Steps
Also note that developers can run custom code at the end of a package install. This is done using the Post Deploy Steps, available on the ‘Deploy’ tab.
There are three out of the box, but you can use any of these community written ones or write your own.
Deploying the Packages
Another thing to note is that the package installation is up to the dev team. They can use whatever works for them to deploy the package.
They can use:
- Sitecore’s Built In Update Installation Wizard
- Sitecore.Ship
- or our own open source Sitecore Package Deployer module
TDS Classic’s Sitecore Package Deployer
When setting up Continuous Integration, it is possible to make the package installation easier by using our open-source Sitecore Package Deployer. The Sitecore Package Deployer installs packages automatically when they are pasted in a certain folder, and makes CI processes easier to implement.
The Sitecore Package Deployer uses a Sitecore Job to automatically deploy update packages that have been copied into a folder on the Sitecore server. This reduces the complexity of deployments because copying files to a web server is already something the deployment process does.
TDS Classic’s Deployment Property Manager
The Deployment Property Manager allows users to deploy items to a Sitecore instance and allows them to further modify that deployment if they do not want the default behavior of every item in the TDS Classic project deploying every time.
Users can modify properties like:
Item Deployment, which determines how TDS Classic will handle the item at deployment.
Child Item Synchronization, which tells TDS Classic how to manage the children Sitecore items that are not in the TDS Classic project.
Exclude from Configuration, where selecting a checkbox next to the build configuration name excludes the selected item and all its children from that build configuration.