Is there a way of Publishing templates and Sublayouts to the web database after a Unicorn Sync

Hi,

I have successfully installed Sitecore Unicorn which works really well with syncing sitecore items from a developers machine to UAT and then Production environments. 

I am using release manager to deploy the code and then execute a powershell script which accesses the unicorn.aspx to sync the items. 

To complete this I would like to publish the templates and sublayouts snyced to the web database.

My thoughts are to execute another powerscript that will publish these templates to the web database. Is there anything that can do this? 

I have looked at the following:

- Sitecore PublishAgent but that seems to be setup to run on interval whereas I just want to publish templates and sublayouts once after a sync only. 

- Sitecore Powershell scripts but that seem to be for developers machines.

- Parameter Driven publish deployment tool on the sitecore marketplace but that doesn't allow you to specify templates and sublayouts only. 

Any ideas?

  • Hi Rebecca,

    I am using the Unicorn configuration to do the publish. There is the Unicorn.AutoPublish.config that you can enable and set up properly. I have the following setting:

    <PublishTriggerItemId>/sitecore</PublishTriggerItemId>

    It will only publish the items that have been added to the publish queue. In my case I do not sync any content items.

    I understand that you need two folders, so I would try to add the processor (<processor type="Unicorn.Pipelines.UnicornSyncEnd.TriggerAutoPublishSyncedItems, Unicorn">) twice, with different PublishTriggerItemId, once for the templates folder and once for the sublayouts. I hope it works!

    Best wishes,
    Cristina
  • My "Parameter Driven publish deployment" github.com/.../Sitecore-Parameter-Driven-Publish is probably not updated anymore, but is easy to adapt to your needs is just c# in a .ashx file. However PowerShell is the way.
    Sitecore PowerShell has today a Remoting Automation Service this is an excellent choice to automate your deploy. for example with VSTS.

    But as Cristina noticed, Unicorn can do the publish on the new and changed Unicorn items. In your case I think Unicorn publish is what you need.