Skip to content

Installation based on XML values

Ro Se edited this page Feb 19, 2019 · 1 revision

Sitecore scaled installation has many roles and installation process can depend on role on other value in Sitecore configuration files. In this short tutorial, I will show how to change script behavior base on search provider configuration. In Sitecore we can define search provider in web.config file.

<add key="search:define" value="Solr" />

With config function TestXmlValue we can check a key value and skip or execute task depends on return value:

 "Skip" : "[not(TestXmlValue(parameter('Web.Config.Path'), variable('XPath.Search'),'Solr'))]"
  "Tasks" : { 
        "Enable Files when Solr" : {
            "Type": "SetSitecoreConfigFile",
            "Skip" : "[not(TestXmlValue(parameter('Web.Config.Path'), variable('XPath.Search'),'Solr'))]",
            "Params": {
                "ConfigDir" : "[variable('PublishingService.Config')]",
                "ConfigFileListToEnable" : ["Sitecore.Publishing.Service.ContentAvailability.solr.config"]
            }
        },