Skip to content

Instantly share code, notes, and snippets.

@cassidydotdk
Last active Jul 1, 2019
Embed
What would you like to do?
Managing Unicorn targetDataStore in Gulp pipeline
var rename = require('gulp-rename');
var replace = require('gulp-replace');
...
gulp.task("B04-Sync-Unicorn",
function(callback) {
console.log("Executing Unicorn Sync");
gulp.src([path.resolve(config.websiteRoot + '/App_Config/Include/zzz/Unicorn.TargetDataStore.config.EDITME')])
.pipe(replace('#repository#', path.resolve('.')))
.pipe(rename('Unicorn.TargetDataStore.config'))
.pipe(gulp.dest(config.websiteRoot + '/App_Config/Include/zzz/z'));
var options = {};
options.siteHostName = config.hostName;
options.authenticationConfigFile = config.websiteRoot + "/App_config/Include/[blah blah]/z.Unicorn/Unicorn.zSharedSecret.config";
unicorn(function() { return callback() }, options);
});
Keep this one in your solution under source control, and deploy it with Build Action Content
...
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<unicorn>
<defaults>
<targetDataStore>
<patch:attribute name="physicalRootPath">#repository#\unicorn\$(configurationName)</patch:attribute>
</targetDataStore>
<roleDataStore>
<patch:attribute name="physicalRootPath">#repository#\unicorn\Unicorn.Roles\$(configurationName)</patch:attribute>
</roleDataStore>
<userDataStore>
<patch:attribute name="physicalRootPath">#repository#\unicorn\Unicorn.Users\$(configurationName)</patch:attribute>
</userDataStore>
</defaults>
</unicorn>
</sitecore>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment