Continuous Integration In Kentico

What is Kentico?

Kentico CMS is a web content management system (WCMS) for building websites, online stores, intranets, and Web 2.0 community sites. Kentico CMS utilizes ASP.NET and Microsoft Sql Server. Kentico allows development via its portal engine or using Visual Studio. Kentico is also compatible with Microsoft Windows Azure Platfrom.

Versions

Included in Kentico 9.

Why CI?

Kentico’s Continuous Integration module, combined with Source Control, offers you the ability to move development coding and data changes automatically from Development through QA, Staging, and on to Production. It supports the synchronization of work between developers and development teams with the same workflow, by allowing them to store code and data in a file system, commit them to Source Control, and import them back into a different Kentico installation within a second environment.

It supports all operations, from the creation and updating of objects to their deletion, and automatically synchronizes these changes locally before storing them in the Source Control.

The system stores the XML files containing the serialized data of objects in the project's CMS\App_Data\CIRepository folder.

Usage

Enabling CI

  • Open the Continuous integration application in the Kentico administration interface.
  • Select the Enable continuous integration checkbox.
  • Click Save.

Storing the CI files in a custom location

  • Creating a junction point
    mklink /J SitePath\Kentico\CMS\App_Data\CIRepository ExternalFolderPath
  • Using a custom storage provider
    StorageHelper.UseLocalFileSystemForPath("~/App_Data/CIRepository", @"C:\ExternalSourceControl");

By Default CI will include all objects in serialization. but we can include/exclude some objects if we want.

Including/Excluding objects from CI

By editing your application's repository.config file which is present under CMS\App_Data\CIRepository folder.

  1. <IncludedObjectTypes>  
  2.     <ObjectType>cms.webpart</ObjectType>  
  3.     <ObjectType>cms.webpartcategory</ObjectType>  
  4. </IncludedObjectTypes>  
  5. <ExcludedObjectTypes>  
  6.     <ObjectType>cms.webpartlayout</ObjectType>  
  7. </ExcludedObjectTypes>  

 

Excluding individual objects 

  1. <ObjectFilters>  
  2.     <ExcludedCodeNames ObjectType="cms.settingskey">CMSSMTPServerPassword;CMSStagingServicePassword</ExcludedCodeNames>  
  3. </ObjectFilters>  
  4. <ObjectFilters>  
  5.     <ExcludedCodeNames ObjectType="cms.webpart">test%</ExcludedCodeNames>  
  6.     <ExcludedCodeNames ObjectType="cms.document">/Testing/%</ExcludedCodeNames>  
  7. </ObjectFilters>   

Running CI

  • Open the Continuous integration application in the Kentico administration interface.
  • Click Serialize all objects.

It will create XML Files under CIRepository folder.

Restoring CI files to the database

Open Command Prompt using Admin rights
Navigate to the CMS\bin folder of your Kentico project and run ContinuousIntegration.exe from the command line with the -r parameter.

ContinuousIntegration.exe -r

this will restore all the db changes using xml files.

Note

The Continuous Integration functionality is only Integrated to use on development instances and has a negative effect on site performance. Do Not leave CI enabled for live production site.