Sitecore Content Sync with Sitecore Content Serialization in Azure DevOps
I have been working on Sitecore 10.2 with Sitecore Content Serialization and I wanted to deploy Sitecore items on VM using Azure DevOps. When I started working on deployment, I rarely find blogs related to this so I thought to write a blog on this topic:
Prerequisite:
Step 1: Add a task in the Azure DevOps pipeline
In the pipeline, add a PowerShell task. This PowerShell task will generate the Sitecore content package.
In the PowerShell task, update the below settings:
Task Version: 2.*
Display Name: PowerShell Script - Content Package Creation
Type: Inline
Script:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.2.1 | |
dotnet sitecore init | |
dotnet sitecore ser pkg create -o test-content-package --overwrite |
Step 2: Add a task in the Azure DevOps release pipeline
- Add a new PowerShell task
- In the PowerShell task, update the below settings:Task Version: 1.*Display Name: PowerShell ScriptType: Inline ScriptArguments: -workingDirectory "$(System.DefaultWorkingDirectory)/<Name>/drop"
Inline Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ($workingDirectory) | |
$package=$workingDirectory+"/test-content-package.itempackage" | |
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.2.1 | |
dotnet sitecore init | |
dotnet sitecore ser pkg install -f $package --client-id CLIServer --client-secret eyJhSSSSiOiJSUzI1NiIs --cm https://xx-cm.xx --auth https://XX-id.XX |
Comments