Integrating SitecoreDXG into your CI/CD Pipeline
SitecoreDXG was designed for easy of integration with any CI/CD pipeline. If you are looking to integrate SitecoreDXG into your TeamCity-based pipeline, see Integrating the Default TeamCity RabbitMQ Meta-Runner. Otherwise, if you are looking to integrate SitecoreDXG into Jenkins, Octopus Deploy, Travis, Codeship, GitLab, Buddy, Semaphore, or any other build tool then refer to the guide below.

Integrating SitecoreDXG into your Build Pipeline via the Command Line

You can integrate SitecoreDXG into your CI/CD pipeline by completing the following two steps:
  1. 1.
    Install the default RabbitMQ Middleman (excluding the TeamCity Meta-Runner definition XML file) on in a location that your build agent will have permissions to access
  2. 2.
    Add a new step to your build that executes the PowerShell script, below (feel free to customize, rewrite or replace this script with your own written in the language of your choice)

Sample PowerShell Script to Call the Default RabbitMQ Middleman

1
## PARAMS #####################################
2
3
$scriptPath = "C:\path\to\rabbitmq-amqp-middleman.js"
4
$rabbitMQConnectionString = "http://localhost"
5
$serializerGetUrl = "http://uat-mysite.com/sitecoreuml/sitecoredxg/GetTemplateArchitecture"
6
$generationQueueName = "generation_queue__documentation"
7
$optionsJsonData = '{...}' # single-quotes intentionally used for proper parsing
8
9
## EXECUTION ##################################
10
11
Write-Output "Beginning execution..."
12
13
$scriptDir = (Get-Item $scriptPath).Directory.FullName
14
$currentLoc = Get-Location
15
16
Set-Location $scriptDir
17
npm install
18
Set-Location $currentLoc
19
20
Write-Output "Dependencies installed"
21
22
$optionsFilePath = ".\$(New-Guid).json"
23
$optionsJsonData | Set-Content $optionsFilePath
24
25
Write-Output "Options JSON file generated at path $($optionsFilePath)"
26
27
Write-Output "Calling SitecoreDXG Middleman..."
28
29
node $scriptPath $rabbitMQConnectionString $serializerGetUrl $generationQueueName $optionsFilePath
30
31
Write-Output "Finished calling SitecoreDXG Middleman..."
32
33
Remove-Item $optionsFilePath
34
35
Write-Output "Cleaned up options JSON file"
36
37
Write-Output "Completed execution"
Copied!