A gulp file I used to do CI with a habitat based website.
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
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"; | |
fs.mkdirSync(config.websiteRoot); | |
runSequence( | |
"Build-Solution", | |
"Publish-Foundation-Projects", | |
"Publish-Feature-Projects", | |
"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" | |
]; | |
console.log(excludeList); | |
return gulp.src(excludeList, { read: false }).pipe(rimraf({ force: true })); | |
}); | |
gulp.task("CI-Copy-Items", function() { | |
return gulp.src("./src/**/serialization/**/*.yml") | |
.pipe(gulp.dest('./Data/unicorn/')); | |
}); | |
gulp.task("CI-Copy-Users", function () { | |
return gulp.src("./src/**/users/**/*.user") | |
.pipe(gulp.dest('./Data/unicorn/')); | |
}); | |
gulp.task("CI-Copy-Roles", function () { | |
return gulp.src("./src/**/roles/**/*.role") | |
.pipe(gulp.dest('./Data/unicorn/')); | |
}); | |
gulp.task("CI-Clean", function (callback) { | |
rimrafDir.sync(path.resolve("./Website")); | |
rimrafDir.sync(path.resolve("./Data/unicorn")); | |
callback(); | |
}); | |
gulp.task("CI-Do-magic", function (callback) { | |
runSequence( | |
"CI-Clean", | |
"CI-Publish", | |
"CI-Prepare-Package-Files", | |
"CI-Copy-Items", | |
"CI-Copy-Users", | |
"CI-Copy-Roles", | |
callback); | |
}); |
Hi,
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?
Thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Perfect, thanks for publishing this.