Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A gulp file I used to do CI with a habitat based website.
var gulp = require("gulp");
var gutil = require("gulp-util");
var foreach = require("gulp-foreach");
var rimrafDir = require("rimraf");
var rimraf = require("gulp-rimraf");
var runSequence = require("run-sequence");
var fs = require("fs");
var path = require("path");
var xmlpoke = require("xmlpoke");
var config = require("./gulpfile.js").config;
var unicorn = require("./scripts/unicorn.js");
var websiteRootBackup = config.websiteRoot;
gulp.task("CI-Publish", function (callback) {
config.websiteRoot = path.resolve("./Website");
config.buildConfiguration = "Release";
"Publish-Project-Projects", callback);
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 }));
gulp.task("CI-Copy-Items", function() {
return gulp.src("./src/**/serialization/**/*.yml")
gulp.task("CI-Copy-Users", function () {
return gulp.src("./src/**/users/**/*.user")
gulp.task("CI-Copy-Roles", function () {
return gulp.src("./src/**/roles/**/*.role")
gulp.task("CI-Clean", function (callback) {
gulp.task("CI-Do-magic", function (callback) {

This comment has been minimized.

Copy link

@markotsoi markotsoi commented Mar 20, 2017

Perfect, thanks for publishing this.


This comment has been minimized.

Copy link

@gauravjain83 gauravjain83 commented Jun 21, 2018


The above script works for Sitecore Habitat 8 but when i use the above script as a build step in TeamCity and deploy using Octopus on a plain vanila Sitecore 9 instance it throws exception. The package is missing some of the dll's of habitat feature.

Could you please the updated gulp-ci which is compatible for Sitecore Habitat 9?


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.