0

We have created out deployment chain from Sitecore and Unicorn with TFS and thats works fine so far. Every time when we deploy a new release we delete the current web folder in the wwwroot from our Sitecore website and copy a clean Sitecore installation folder into this folder and after that we are copying our source files like yml and dlls and views, ... into the folder.

But I don't know how to handle the installation of new modules. The current solution would be I need to have a second server with a clean Sitecore installation where I can install the module and then I can take the new "wwwroot\sitecore.local" folder as new source for my TFS setup is that the right approach or how do you manage your Sitecore deployment when you need to install new modules?

  • I've decided to use the Soltion from Mark Cassidy here no one need to install the package itself and you have everything in the same solution. I've also only one Big project and I don't need to reuse my components in other projects – squadwuschel Sep 21 '18 at 5:02
2

Using Unicorn (but would definitely also be possible with TDS), I've created "module projects" in the past. And then just deployed those along with the rest of the solution.

The process was simply.

  1. Create a new Web Project
  2. Install the module locally
  3. Identify the assets of the module (sits in the files folder of the package) and include them in the new project
  4. Make a Unicorn.config for all the items in the package
  5. Serialize, and check in.

And done.

Another benefit of this approach is, that there is no need for other developers to do manual module installs on each of their machines - thus not having to deal with long "how to set up your local development environment" documents that never really get updated anyway.

  • In which Layer do you create the Project in the Feature or Foundation and do you create for each Module a separate project? Beside the project I've the serialization folder for the Items which are created and Synched and then I need to add also the files into the project so that they are deployed right ? – squadwuschel Sep 19 '18 at 12:45
  • Depends. Some would argue this fits in a "common" project, where you would also keep Sitecore hotfixes and other material not directly part of your main project/solution. But I generally create 1 project per module, so it's easy to later update to a newer version of the same module. – Mark Cassidy Sep 19 '18 at 12:47
4

There are a few ways to handle this but the best way I've found are to create NuGet packages for your modules and then have your build server (Octopus / Team City / Jenkins / TFS etc) execute a step to deploy the NuGet package after your Sitecore deployment has completed. You would need to ensure the packages are installed locally/dev (wherever is your source environment) first and then the Sitecore Items from the package will be Synced with Unicorn and deployed to other environments.

The NuGet packages only need to contain the files, config, dlls etc.

Some Sitecore modules have a GitHub repo and an NuGet package is available for it, so you could add it to your project in that way and the NuGet package restore should add everything required.

For those Modules that don't you can just extract the Sitecore package zip and then put the required files into a NuGet package.

For example the Url Redirects module from the Marketplace does not have a NuGet package. Here is what would be in the NuGet Package after unzipping the Sitecore Module package and adding the files from it:

enter image description here

  • /bin - contains the Hi.UrlRewrite.dll etc
  • /App_Config - contains the patch config files to add the module to the Sitecore config.
  • /sitecore modules - contains pages, files, css etc used by the module

There is further info on this here:

https://www.velir.com/blog/2012/12/04/create-and-deploy-sitecore-modules-nuget

http://hermanussen.eu/sitecore/wordpress/2013/05/turn----any----sitecore----package----into----a----nuget----package/

Also if you wanted to host your NuGet packages internally on a private feed it looks like this is pretty easy to setup for TFS:

https://www.benday.com/2017/05/03/walkthrough-publish-to-private-nuget-server-from-tfs2017-build/

  • I need to install the Nuget Pakage locally too or? In which project do you install the package or did I miss something? – squadwuschel Sep 20 '18 at 5:20
  • @squadwuschel once you've created your packages you can host your NuGet packages on an private internal feed (see the link above for doing this with TFS) you can then set these up in TFS to deploy as part of your build, there is some info on this here: blogs.like10.com/2018/01/21/… and here: chamindac.blogspot.com/2018/06/… – Adam Seabridge Sep 20 '18 at 10:24
  • Ok that with the TFS I understand, but how does it work in my local development process here I need to "deploy" the Nuget Pakages too to my local Installation with powershell or how does it work. Because when I understand it right I don't host any of the code inside my TFs Project its just inside the NuGet – squadwuschel Sep 20 '18 at 11:36
  • 1
    I'd usually just install the packages locally in the normal way with the Sitecore package manager. once they are installed locally once they should work fine. Then on other environments use the NuGet package approach. Installing locally should also mean Unicorn picks up the Sitecore items and pushes them to your other environments too. – Adam Seabridge Sep 20 '18 at 11:55
2

There are two ways for deployment

1. Unicorn - It’s open source which is installed via NuGet.

a. Install Unicorn

b. Please check the unicorn folders and it’s related configuration files created on the path App_Config/Include/Unicorn.

c. Unicorn provide an example configuration file in that folder(Uncorn.Configs.Default.example.file). Open the file and find node on the file and include the paths that contains items that you need to be serialized.

d. Publish your items and deploy your solution. Navigate to webroot/App_Data/Unicorn and check the empty folders are created that you are provided in the configuration file.

e. All now set, To perform serialize , run /Unicorn.aspx page.the default unicorn dashboard opens,Click perform initial serialization button, this will creates a serialized files in the webroot/App_Data/Unicorn/ location. f. check -in the serialized items.

2. TDS - not a open source

a. It keeps tracking of changes in your project. b. we can easily select changed items and build a package and deploy.

for more info http://rajsitecore.blogspot.com/2018/11/serializing-items-using-unicorn-in.html

  • Rajasekar I'm not sure this is what the OP was asking. He was asking how best to manage the deployment of Sitecore Modules (e.g WFFM, SPE, Url ReWrite). I think your answer is about how to manage the deployment of code/config/Sitecore items. – Adam Seabridge Mar 29 '19 at 10:03
0

Personally - I have done either similar to Mark's approach above.

More often than not now I actually prefer to create a build that creates you your 'Platform'. This then serves to replace the use of the original vendor files as your 'blank installation'. This is often uploaded to s3 / blob storage so can be downloaded by developers.

So - often the 'Platform' will consist of (for example)

  • Sitecore
  • Sitecore powershell extensions
  • WFFM
  • Rewrite Module

This holds several advantages of this approach over the one Mark suggests in that

  • The visual studio solution publish is not bogged down deploying a tonne of files it doesn't need to.
  • The visual studio solution load times are improved (especially if you use tools like Resharper) as it has a load less files to scan
  • Your visual studio solution contains ONLY customisations not vendor supplied files
  • Greater flexibility in deployment
  • Significantly smaller package sizes during deployment

So using this approach I have managed to get zero downtime deployment times down under 5 minutes including stopping IIS (this on its own can take 1.5 minutes), load balancer control, site warm up with a complete deletion and recreation of the files on disk. This is key in my mind to increase confidence and velocity within agile delivery teams.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.