Setup Sitecore project’s source code to Azure DevOps repository

  1. Create Project (New) ‘DemoProject’

  • The default repository name will have project name ‘DemoProject’. Select Repository ‘DemoProject’, you will see the message that it is empty.
  • Click on Clone button and get credentials for clone ‘DemoProject’ on your local machine.
  • Using Git credentials clone ‘DemoProject’ on your local machine and also you can push file on Azure Git.

Setup Azure DevOps CI Build for Sitecore Source Code

In this blog part we will see, how to setup Continuous Integration process (CI) for Sitecore Source Code. This will help for the project teams who want to setup Continuous Integration process (CI)

Update Project with below Gulp Script

  1. Update ‘gulp-config.js’

Update the buildToolIsVersion to ‘auto’, the default value will be 15.0

  • Update ‘gulpfile.js’

Include the below content into ‘gulpfile.js’


  CI Publish

  Credits to James – Inspired from :


gulp.task(“CI-Build”, function (callback) {








gulp.task(“CI-Publish”, function (callback) {

    config.websiteRoot = path.resolve(“./Output”);

    config.buildConfiguration = “Release”;






        “Publish-Project-Projects”, callback);


gulp.task(“CI-Clean”, function (callback) {




gulp.task(“CI-Copy-Items”, function () {

    return gulp.src(“./src/**/serialization/**/*.yml”)



gulp.task(“CI-Prepare-Package-Files”, function (callback) {

    var excludeList = [

        config.websiteRoot + “\\bin\\{Sitecore,Lucene,Newtonsoft,System,Microsoft.Web.Infrastructure}*dll”,

        config.websiteRoot + “\\compilerconfig.json.defaults”,

        config.websiteRoot + “\\packages.config”,

        config.websiteRoot + “\\App_Config\\Include\\{Feature,Foundation,Project}\\z.*DevSettings.config”,

        “!” + config.websiteRoot + “\\bin\\Sitecore.Support*dll”,

        “!” + config.websiteRoot + “\\bin\\Sitecore.{Feature,Foundation,Habitat,Demo,Common}*dll”



    return gulp.src(excludeList, { read: false }).pipe(rimraf({ force: true }));


  • The ‘CI-Publish’ task will allow you to set the publish ‘output’ folder path. (you can customize the folder name as required). Also set the ‘CI-Clean’ task with the same path. In this example ‘./output’ is the folder name is considered.
  • Run the ‘CI Build’ task from the Visual Studio ‘Task Runner Explorer
  • Check if the all the project build output is published to ‘Output’ folder in local machine.
  • Since the output folder contents are not required to be pushed/committed to repository, it is better to ignore that folder. So, update the ‘.gitignore’ with ‘Output/*’ and Save.
  • Update the ‘Package.json’ gulp-msbuild with latest version. The default version will be ‘0.4.4’ the lastest version is ‘0.5.5’
  • Update the ‘nuget.config’ with Sitecore Nuget feeds Path and comment the ‘Sitecore v2’ and ‘Sitecore v3′, add the below line

<add key=”SitecoreNuGet” value=”” />

  • Commit these 5 files to the repository.
  • .gitignore
  • gulpfile.js
  • gulp-config.js
  • package.json
  • nuget.config
  • After you commit these changes to repository check if you are able to see the changes on the repository.

I hope this article will help you to configure the DevOps!

Please let me know if you have any specific issue.

Connect me on Twitter – or Linkedin –

Happy Sitecoring and Cloud

Leave a Reply

Your email address will not be published. Required fields are marked *