Contact Us

Deployments are frequent in every software-based specialization. Manual deployments seek human time and inflated latency. However, automated deployments have emerged as more suitable for those needing consistency and frequent push in the production unit.

In situations when you need to push or deploy modifications into numerous environments, Sitecore packages ease out the operation by lowering the complexity of deploying.

Serialization refers to the attainment of serial events in the flow. Hence developers need to synchronize the changes and updates they perform in the local system to the central database to sidestep the loss of content.

The Sitecore Content Serialization packages incorporate every introductory module required as a build artifact in your pipeline integrations. Further is the step-by-step demonstration of building the Sitecore Item Package during the build and delivery pipeline in Azure DevOps.

The steps are for an on-premise Virtual Machine Deployment and should be compatible with similar cloud scenarios.

 

Configuring the Azure DevOps Build Pipeline for CM

Add two tasks to your agent job. This should be a Powershell tasks.

  • In the first powershell task (ref. Install Sitecore CLI), select the “Inline” type and add in the follow code to the “Script” field.
    • dotnet new tool-manifest
    • dotnet nuget add source -n Sitecore https://sitecore.myget.org/F/sc-packages/api/v3/index.json
    • dotnet tool install Sitecore.CLI --version 4.1.0
    • dotnet sitecore plugin add -n Sitecore.DevEx.Extensibility.Serialization --version 4.1.0
    • dotnet sitecore plugin add -n Sitecore.DevEx.Extensibility.Publishing --version 4.1.0

    (Note: We have installed CLI 4.1.0 version you can change the version as per the latest available versions)

    1

    When the agent runs the job, Sitecore.CLI will be installed in the Agents working directory. Once that occurs, you can then call Sitecore.CLI commands via Powershell. When the agent runs the job, Sitecore.CLI will be installed in the Agents working directory. Once that occurs, you can then call Sitecore.CLI commands via Powershell.

    2

    3

     

  • In the second powershell task (Create Sitecore Serialization Package), select the “Inline” type and add in the following code to the “Script” field.

    • dotnet sitecore ser validate –fix
    • dotnet sitecore ser pkg create -o Project --overwrite

    The Powershell task will list all the items that it will include in the package.

    4

    A summary is provided when the task is complete.

    5

    Finally, you will need to publish the package as a build artifact. Add a task to the Agent that is the type of “Publish build artifacts”. The path to publish is the name of the item package.

    6

    When the build completes, the artifact looks like this:

    7

    Configuring the Azure DevOps release pipeline for CM

    • To avoid manual work, we need to configure a non-interactive client login on the CM/Identity Server to create the release pipeline. Follow the documentation provided the Sitecore: https://doc.sitecore.com/xp/en/developers/102/developer-tools/configure-a-non-interactive-client-login.html
    • Create the release pipeline as you normally would. Add the final two steps/tasks for installing the Sitecore CLI and installing the Sitecore Content Serialization Item package.

    8

    In the inline Powershell, we again install the Sitecore.CLI to the current agent’s directory.

    9

    After the installation, we call the serialization install command, passing along the client id, client secret, cm URL, and identity server URL. Next, the working directory is a parameter passed into the script, and the package location is constructed from that. Further, we call the final publishing command.

    Post successful completion of the above package installation step, you will see the below message -

    10

    Conclusion

    Developers collaborate simultaneously over a particular software, wherein the synchronization becomes significant. If synchronization between the databases is not attained, then the final version may not serve.

    The Sitecore Content Serialization system functions depending upon the properties determining the consequence of serialized command over the content items.

    Synchronization is much required by multiple developers and even from a single developer perspective to keep the content in version control. Get in touch with us for Sitecore queries. Our Sitecore experts will be happy to help.

Need Help?