Skip to content

Instantly share code, notes, and snippets.

Created September 30, 2016 05:49
Show Gist options
  • Save jameshirka/c8260ff4f17c78c33cea77bfc1417b17 to your computer and use it in GitHub Desktop.
Save jameshirka/c8260ff4f17c78c33cea77bfc1417b17 to your computer and use it in GitHub Desktop.
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) {
Copy link


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