Blog

TDS Classic Builds on Jenkins Build Server with NuGet Packages

May 10, 2017 | Kliment Klimentov

Environment Overview 

TDS Classic builds on Jenkins Build Server environment overview  

Our simple scenario includes 2 developers, using TDS Classic and checking-in changes to source control. The Jenkins build server takes the changes and perform the build, then deploy the created package to two Sitecore environments. The QA environment will apply the changes automatically and the Production environment will wait for manual installation of the package.

TDS Settings

Add Items from a local Sitecore instance

First, connect TDS Classic to a Sitecore instance and get the needed items. In this scenario, I'll connect to a local Sitecore instance in my Debug build configuration and add a few items to the project. 

Connect TDS Classic to a Sitecore Instance

Create a new build configuration and configure it to create a packages

1. Create a new Build Configuration

After the initial items are in our project, we need to create a new build configuration, which will be used by Jenkins to build the files and items and create .update package. I'll name the Build configuration "Create Package"

Create a new Jenkins build configuration

2. Configure TDS Classic to create packages

In this example setup, we will use .update packages to apply changes in the Sitecore instances. To create .update packages during build, the following settings need to be set for the CreatePackage Build configuration:

Configure TDS Classic to Create Packages

For the CreatePackage configuration leave the Sitecore web URL and the Sitecore Deploy Folder settings in the Build tab blank. This will prevent TDS Classic from deploying the items and it will only generate a package.

On the Update package tab check the Generate package during build checkbox. Leave the assembly path empty and add the Sitecore assembly files as NuGet Packages. Here's how to do that.

3. Add NuGet packages

To successfully build the TDS Classic projects on the Jenkins build server we need to have TDS Classic installed on the server, or to install the HedgehogDevelopmentTDS NuGet package to our Solution. The TDS Classic build components can be installed to the projects by right-clicking the Solution in Visual Studio -> Manage NuGet Packages for Solution. For more on how to do this, check our our blog post on the subject.

Jenkins Settings

1. Connect to source control

To be able to get and build the items and files, Jenkins build server needs to be connected to the source control repository. This can be configured in Jenkins -> <Project> -> Configure -> Source control management

2. NuGet Restore step

To be able to build successfully in the Jenkins Build server, you have to Restore all NuGet Packages. The first build step will execute a Windows batch command and will restore all NuGet packages in the packages directory of the solution. The command is:

<path to nuget.exe> restore <path to solution file on the build server>

The nuget.exe can be downloaded from the official NuGet website.

3. MS Build step

The second build step will build the solution using the "Create Package" configuration. To do this, you have to create another build step which builds a Visual Studio project or solution using MS build. In this step you need to specify the MSBuild version, the name of the Solution file and the command line arguments. Our arguments will make MS build to use the "Create Package" configuration:

/p:Configuration="Create Package"

4. Deployment step

The deployment can be handled by a copy-paste script, which will copy the generated .update package to a network share.

Package Installation

In our QA instance the packages will be installed automatically, using the Sitecore Package Deployer.

In the Production instance, install the .update packages manually to prevent the installation of a broken package

Licensing

To build successfully, TDS Classic needs to be licensed on the Jenkins build server. Since TDS Classic is not installed on the server, you need to add your license info as environment variables. The license key must be added as two environment variables with TDS Classic license info as values:

TDS_Owner: <company name>
TDS_Key: <TDS license key written in this pattern: aaaa-bbb-ccc-dddd>

 

Sitecore TDS Classic Jenkins Build development

Related Blog Posts

TDS Classic How-To: Disable Automatic Code Generation
Code Generation is automatically triggered after every change in the TDS Project tree. If a project contains many items, users can disable this feature for their convenience.
TDS Classic Sitecore Deploy Folder
Sitecore Deploy Folder is a setting, located in the build tab of the TDS Classic Project's Properties page, and used to tell TDS Classic where the webroot is located.<br>
Features to Improve Sitecore Development: TDS Classic Strikes Back
Each and every feature in TDS Classic is aimed at helping developers. Whether the feature is out front or running quietly in the background the goal is always the same: make the development experience better. &nbsp;&nbsp;
Feydra and the Virtual Sandbox
Feydra virtualizes all front end assets (css, js &amp; cshtml) of a Sitecore instance. With Feydra, front-end developers can commit their changes to Source Control without requiring the intervention of a back-end developer. We call it a virtual sandbox.&nbsp;
Feydra Frequently Asked Questions
Answering a number of excellent questions we've gotten from the community regarding Feydra, including how long it takes to set up a Feydra environment and how to install the product.&nbsp;
TDS Classic Features to Improve Sitecore Development
Each version of TDS Classic comes with the same goal: to make Sitecore development and, by extension, developers, lives easier. Every feature in our products is aimed at making the process better - some of these features aren't quite as well-known as others, but they all help smooth and improve the development experience.
Deployment Properties and the Deployment Property Manager
When working with TDS Classic, you will eventually need to deploy your items to a Sitecore instance and you might not want the default behavior of every item in your TDS project deploying every time. This is where the TDS Sitecore Deployment Property Manager comes in!
Feydra: A Front-End Assessment
Feydra allowed me to start building the front-end in a very short time with no Sitecore experience, and it let me use tools that I was comfortable and familiar with.
TDS Classic How-To: Use the HedgehogDevelopment.TDS NuGet Package
The HedgehogDevelopment.TDS NuGet Package allows you to build TDS projects, without the need of installed TDS on the build server machine.
Feydra: A Quick Start Guide
A step-by-step guide for installing, configuring and, most importantly, using Feydra from the front-end.
TDS Classic 5.6 Feature Spotlight - Prevent Deployment of Incorrect Assemblies
This feature, new to TDS Classic 5.6, will prevent a solution from deploying unless all assemblies (except the excluded assemblies we allow you to specify) match what exists in your webroot.&nbsp;
Feydra from the Front-End
Feydra eliminates common roadblocks for designers and front-end developers working on Sitecore projects by getting them up and running more quickly and allowing them to use the development environment and workflow tools they prefer.&nbsp;
TDS 5.6 Feature Spotlight - Project Item Report
This feature, new to TDS Classic 5.6, allows you to create a report of all items in the TDS Classic project.&nbsp;
TDS How To: Install the TDS Connector for Rocks 2.0
Manually install the TDS connector for Sitecore Rocks 2.0
Using NuGet Packages in TDS
New to TDS 5.5 is the ability to create and consume NuGet packages in your TDS project, allowing developers to capture their Sitecore items and easily distribute them across multiple teams.
Occasional Issue Seen with TDS Installer
When upgrading to TDS 5.5.0.x from an older version and trying to load a solution with a TDS project inside, the following error might occur:
TDS: The Evolution of Auto-Sync
Auto-Sync has been described as a new feature, but in reality has existed in TDS since 2010 and has taken a new form in TDS 5.5, due to be released March 22, 2016
TDS for SC Hackathon 2016
For all those participating in the Sitecore Hackathon, check out our Habitat for TDS and some other cool surprises.
Config Transforms for Config Files
If you don't want to use a third party development tool for your config transforms, I have good news. Config transforms are supported natively within TDS!
Package Installer from the Command Line
The TDS package installer allows you to install packages through the command line. Learn how...<br>
New Build for TDS 5.0!
A couple bugs were reported over the last few months. We've been able to fix the bugs and now have a stable CTP version for use.
It's finally here!
Team Development for Sitecore has finally been released go download it now!
Team Development for Sitecore Webinar
Our Sitecore MVPs Charlie and Sean recently did a demo of TDS to all Sitecore partners. We recorded the demo to share with the world.