Xperience provides a continuous integration (opens in a new tab) solution that allows you to serialize the data of objects from the database into XML files on the file system. You can then add the files to a source control system (opens in a new tab) (for example Team Foundation Server (opens in a new tab) or Git (opens in a new tab)) and use them to synchronize database data between team members. The system ensures that the XML data of matching objects is always identical and consistent (including element and attribute order), even when serialized on different instances of Xperience.
The system stores the XML files containing the serialized data of objects in the project's CMS\App_Data\CIRepository folder. For details about the folder and file structure, see Continuous integration repository structure.
The continuous integration solution is usable in the following environment:
To start developing sites using the continuous integration solution:
Set up your development environment and continuous integration according to the instructions in:
Establish a process for transferring objects back into the database from the CIRepository XML files. See Restoring continuous integration files to the database and Synchronizing database changes not managed by continuous integration.
Begin development. We strongly recommend following the best practices described in Using continuous integration with Visual Studio. The page primarily focuses on using Visual Studio in combination with a Team Foundation Version Control or Git source control repository, but many of the recommendations also apply generally to any source control system.
Repository location
Both the MVC live site and Xperience administration applications that run and provide management of your website must use a shared location for the continuous integration repository. This ensures that content or object changes made through the MVC website are correctly reflected in the continuous integration data.
By default, all MVC projects created by the Installer have their continuous integration repository mapped to the CMS\App_Data\CIRepository folder of the related administration projects, and no manual steps are necessary.
If you wish to adjust the repository location or perform the configuration manually for an MVC project, see the Storing the continuous integration files in a custom location section.
Continuous integration is designed to allow synchronization and version control of database data during development (through an external source control system).
Continuous integration has a negative impact on site performance. The impact is not significant for development instances with a low number of users, but continuous integration should not be enabled on production sites. For more information about deployment options, see the Deploying data to production sites section.
Additionally, we do not recommend using continuous integration together with the other team development and versioning features in Xperience:
Continuous integration always works with the main version of each object in the database. Older or deleted versions of objects and non-published versions of pages (including their child objects) are ignored. For example:
Page workflow
When using the page workflow feature, the majority of workflow information is not tracked by continuous integration. This includes moving pages to different workflow steps and using the check-in/check-out functionality. Pages under workflow are fully stored in the repository only after they are published. When creating a new page, the page data is stored without its child objects. If you make changes to the content of a page, non-versioned page data is stored immediately while versioned page data is stored only when the page is published.
Note: The workflow functionality itself (including Content locking and Page versioning) is not affected when used together with continuous integration. For example, your content editors can use basic and advanced workflows to manage life cycles of pages on a single Xperience instance. When pages reach the Published step, the page content is stored in the repository.
Continuous integration currently has the following limitations:
Before you can use the continuous integration solution, you need to set up Xperience instances for your development team.
Start by preparing an initial instance:
To add development instances into your environment, perform the following steps for each instance:
Connect to the source control from the development machine and load the latest version of the solution files onto the local file system.
Decide how to handle source control for the project's web.config file. Each development machine needs to have a connection string to a different database, but you may want to synchronize other parts of the web.config.
If you use IIS to run your development sites, register the project as an application in IIS:
Create (restore) a copy of the initial database on your SQL server.
Connect the instance to the new copy of the database (set the appropriate connection string in the project's web.config).
After you complete the process, all development machines will contain their own Xperience project files connected to a separate copy of the database. You can start using your source control system to synchronize project files between the instances. The continuous integration solution serializes database data onto the file system and you can include it in your source control, just like any other files.
The process described above ensures that objects have identical GUID values (globally unique identifiers) across your entire development environment. If you perform a separate database installation for each development instance, you will need to manually resolve a large number of GUID conflicts when synchronizing data through the continuous integration solution.
If you need to add further instances later (after development with continuous integration starts), use the same process. However, you need to make sure the database is synchronized with the rest of the development environment. Use one of the following approaches:
Maintain a central database connected to the mainline source control and always create an up-to-date backup for new developers.
– OR –
Use the original database backup and then get the latest data:
To configure an Xperience instance to use the continuous integration solution, perform the following steps:
The project's CMS\App_Data\CIRepository folder now contains XML files storing the serialized data of all supported objects from the database. The system also tracks create, update and delete operations for the given objects and automatically transfers the changes to the serialized data on the file system.
For detailed information, see: Working with macro signatures
To ensure that macro expressions work correctly when synchronizing objects using the continuous integration solution, all development instances must use the same hash salt value.
If your development instances do not all start with the same web.config file, you need to set a matching value for the CMSHashStringSalt key in the appSettings section on all instances. The best option is the hash salt used by the starting instance that you used to create your initial database backup. You can use any string as the value, but the salt should be random and at least 16 characters long. For example, a randomly generated GUID (opens in a new tab) is a strong salt:
<add key="CMSHashStringSalt" value="e68b9ad6-a461-4707-8e3e-ece73f03dd02" />The salt value is used as part of the input for the hash function that creates the security signatures of macros. Having the same hash salt value on all instances is necessary to ensure that macro signatures are valid when transferring data between instances.
The best option is to set the hash salt value before you start development. Changing the salt causes all current hash values to become invalid. To fix existing macro expressions in the system after changing the hash salt, you need to re-sign the macros.
You may also encounter problems with invalid macros if you do not synchronize all users between the instances in your environment. Macros are not valid if the user in the signature does not exist on the given instance.
To ensure that all macros work correctly regardless of the available users, set up macro signature identities:
Macros will now be signed using the assigned identities instead of user names. The identities are available on all instances, so you do not need to synchronize the user accounts.
Deployment of content and data to instances that host live websites is not the primary purpose of the continuous integration solution. Instead, we recommend using the Staging functionality for deployment:
If you use staging to deploy pages, we also recommend setting the CMSStagingUseAutomaticOrdering key to false in the appSettings section of the web.config file on all target servers.
<add key="CMSStagingUseAutomaticOrdering" value="false" />The key ensures that the order of pages in the content tree remains consistent after staging. If you leave automatic ordering enabled on the target staging servers, the Content -> Content management -> New page ordering setting of each site may override the original page order created by the continuous integration restore process.
If you do decide to deploy data to a live production site via the continuous integration restore functionality, use the following process:
Warning
Restoring data through continuous integration deletes any pages and supported objects that are missing in the CIRepository folder. You may lose content created directly on the production instance through standard editing or live site interaction.
For example, the following scenario is possible:
Optionally, you can configure the repository.config file on the production instance to exclude any object types that you do not wish to update and overwrite on the live site.
Leave continuous integration disabled on your production Xperience instance (the setting in the Continuous integration application). Continuous integration has a negative impact on site performance and should not be enabled on production sites.
Important: You can restore data even when continuous integration is disabled.
Upload the CIRepository folder containing the required data into the CMS\App_Data folder of your production instance.
Restore the CIRepository content to the production database – see Restoring continuous integration files to the database.
Restart the application (if not done automatically by your restore process). Open the System application and click Restart application on the General tab.
The data is now deployed to the production database. Keep in mind that any changes made in the administration interface or on the live site will not be tracked and reflected in the CIRepository folder.
If you need to apply a hotfix or upgrade to an instance that has continuous integration enabled, use the following procedure:
Restore objects from the continuous integration repository to your database.
You can skip the restore if you are sure that your database is synchronized with the current status of your CIRepository folder.
Apply the hotfix or upgrade.
Run complete serialization for all objects to recreate the content of the CIRepository folder:
This approach ensures that your CIRepository folder contains all object changes made by the hotfix or upgrade and that the serialization process itself runs according to the new version.
For hotfixes, you need to apply the update separately for each development instance. After one developer commits the hotfixed changes to the source control, other developers CANNOT commit or load changes until they apply the hotfix to their own instance.
For major upgrades, it may be more efficient to upgrade only one instance and then set up your environment again according to the process described in Preparing the development environment.
After you set up and enable continuous integration, the system serializes database data into XML and stores the results on the file system. By default, the files are created in the project's CMS\App_Data\CIRepository folder.
If your development environment requires a different location for the continuous integration file repository, configure the CMSCIRepositoryPath key in the appSettings section of your project's web.config file. The key's value must be an absolute or relative path of a folder on a local drive, or a network location for which the application has sufficient permissions, for example:
<add key="CMSCIRepositoryPath" value="C:\ExternalSourceControl\CIRepository" />When serializing object data to the file system or restoring data back to the database, the system now uses the specified folder as the root of the continuous integration repository. You can add the folder into your source control system.
You can use the key to set a shared continuous integration repository. This is the default configuration for MVC projects created by the Xperience installer.
Important
We recommend keeping your continuous integration repository in the App_Data folder of the administration web project and having the entire Xperience solution included within your source control. This setup allows you to easily synchronize all types of related project files together with the database data tracked by the continuous integration solution.
If you do decide to change the CIRepository location, do NOT use the new folder as the root of your overall source control repository. Always add it as a subfolder under a different root folder. The continuous integration solution deletes all folders within CIRepository when storing all objects. If the folder is the root of your source control repository, you may encounter errors or other problems when using source control systems that utilize custom folders in the root.
By default, the continuous integration solution generates non-binary files in the CIRepository folder using UTF-8 (opens in a new tab) character encoding.
If you need to use a different encoding type for the repository files (for example due to requirements of a file comparison tool), add the CMSCIEncoding key to the appSettings section of your project's web.config file. For example:
<add key="CMSCIEncoding" value="utf-16" />The CMSCIEncoding key supports values matching the encoding names listed in the Encoding Class (opens in a new tab) article.
Note
Changing the value of the CMSCIEncoding key does not update the encoding type of existing files in the CIRepository folder. To fully update the encoding of the repository content, you need to: