Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Georges 11 posts 32 karma points
    Dec 20, 2012 @ 19:46
    Georges
    0

    Why are doctypes in the database ? And other source control concerns.

    Hi, 

    We've been working with Umbraco for a couple of years now, and always looking into integrating our project through GIT and get it into our contunious integration enviorment. Because Doctypes, DataTypes, Macros, etc.. are stored within the database the confiugrations aren't kept within the source control of the solution. 

    So my philosophical question is, why are these configuration entities held within the database instead of a configuration file that can be copy/paste from a project to another ? 

    Do you have any good setup recommendations for a continious integration enviorment ? 

    Cheers!

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Dec 20, 2012 @ 23:38
    Lee Kelleher
    0

    Hi Georges,

    If you haven't already, do take a look the uSiteBuilder add-on.  It enables you to define your DataTypes, DocTypes, Templates, etc as .NET POCO classes - which are much easier to have under version control.

    If you already have your DataTypes, DocTypes, etc defined in the back-office, then there is a package called uSiteBuilder Admin that will help you export them as C# classes.

    Cheers, Lee.

  • Georges 11 posts 32 karma points
    Dec 20, 2012 @ 23:59
    Georges
    0

    Sounds great! We should have totally missed it.

    We'll give it a try and write back the feedbacks and setup we've managed. 

    Cheers !

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Dec 21, 2012 @ 00:02
    Lee Kelleher
    0

    At the last UK festival, Pete Duncanson did an intro session about it, well worth watching: http://www.youtube.com/watch?v=1MXpP4oSXqM

  • Georges 11 posts 32 karma points
    Jan 29, 2013 @ 15:39
    Georges
    1

    Hi Lee, 

    Giving back a bit of feedback about our "almost" killer setup ! As mentionned before, we already had a complete CI setup and automatic deployement process for our "pure" applications but had difficulties integrating the Umbraco part within the process. 

    Here are the highlights, and my remaining questions for a "perfect"setup !

    • We've setup an SLN solution using uSiteBuilder. Every member team works on his local DB and local enviorement and the complete solution is within our GIT scm. 
    • We've also setup Jenkins to check, pull and build in a CI fashion the changes made by the team. Runs unit tests and Jenkins also deploys the Umbraco Site/Application as an artefact.
    • Using uSiteBuiler, every new doctype gets created and the "remote" database gets updated automaticlly, which is great !
    • After deployment, we run our set of Automated tests, using Selenium to make sure the Umbraco Installation works as intended after the changes. 
    • When all the tests pass and have a successful build, we push our successful artefacts into a GIT repo
    • Our production servers get updated auto-magiclly by pulling the latest changes from the release repo
    As mentionned, uSiteBuilder and the recommendations provided have helped us a lot into moving the most part of the Umbraco configurations from the database into our SCM. But some of our automated builds still fail because of the MVC TEMPLATES and the DATATYPES added.  
    When working with the masterpages, we only needed to drop the templates in the repo, in order for it to be created within the Umbraco database. But it seems to have changed when using the MVC templates, they don't seem to be picked up by Umbraco and aren't created within the database. A similar issue goes for the DATATYPES. 
    Looking into resolving the issue, we're currently thinking about creating a "helper class" to allow us programmaticlly create new templates and datatypes. And this helper would be called upon every update within the CI making sure the templates and datatypes are "synced" upon deployment. 
    Althought the idea seems to be a good one, I'd rather have a "lighter" setup that would be more integrated instead of going through custom developement that we'll need to mantain in order to keep up with the Umbraco Versions. 
    Any recommendations to ensure the "syncing" of the templates and datatypes without having to manually create the enteries through the Umbraco admin ? 
    Keep on rocking the CMS world with UMBRACO !
    Cheers !
    Georges.
  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jan 29, 2013 @ 15:46
    Lee Kelleher
    0

    Hi Georges, all sounds good! #h5yr

    Not sure if you'd already looked into it, but uSiteBuilder also supports Templates and DataTypes creation.

    Take a look at the uSiteBuilder Admin package - export the Templates/DataTypes from there ... then you can see how the C# classes are created, so you can develop/extend your own.

    Cheers, Lee.

  • Georges 11 posts 32 karma points
    Jan 29, 2013 @ 15:50
    Georges
    0

    We did look at the templates, but it seemed to work for webforms, not MVC ! Did we go through the documentation too quickly ?

    We'll take a closer look for the datatypes. 

    Thanks again !

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jan 29, 2013 @ 16:52
    Tom Fulton
    0

    Hi Georges,

    Yeah, uSiteBuilder doesn't seem to work for creating MVC templates.

    The good news is, it's open source, so it might be worth having a look around to see what's involved with adding that support.  Not sure if anyone else has taken a stab yet.  It's on my to-do list eventually :)

    I imagine the solution might involve creating some empty classes to define the templates, ie:

        public class SomeNewTemplate : TemplateBase { }
        public class SomeChildTemplate : SomeNewTemplate { }

    If you do this now, uSiteBuilder will actually create the templates in the DB - but they're empty and don't keep their inheritance.

    Could be a bit tricky though, as I think Umbraco supports hybrid engines too (some view sand some masterpages), so might need to keep that in mind.

    -Tom

  • Georges 11 posts 32 karma points
    Jan 29, 2013 @ 21:22
    Georges
    0

    Hi Tom, Hi Lee, 

    I'll start by saying, Lee you kick a#$!

    Thanks for the hint of using the Admin export. 

    For the templates it works great. Tom, as for the inheritance we tested it, and for MVC layouts it doesn't seem to matter. What we did :

    • In our SLN projet, we added a Templates Class that simplily declares the templates we need.
    • Then within to the Umbraco Project and add your "template layout" file giving it the same name as your created in the Template Class
    • When updating, the Template Class will create the database entries (without inhenritance) and when running, Umbraco the Database enteries will be linked to the matching exiting file (*.cshtml) in the /Views directroy of umbraco commited in the source control.
    • As far as our tests go, it works great. Except when removing the templates (which is normal behaviour) where you need to manually remove the template entery from the Umbraco Admin.

    Lee as for the Datatype, we got a little surprise :)  The uSiteBuilder Admin uses a modified version of the uSiteBuilder dll. And the modifed version has some blocking bugs (i.e. DocumetTypeBase doesn't have acces to the standard Name property of any Node). So, for the Datatypes, w'ell probablly stick to the manage it manually until supported by the standard uSiteBuilder dll. 

    Agains, thanks for the help. Much appreciated !

    Cheers !

    Georges.

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jan 29, 2013 @ 21:26
    Lee Kelleher
    0

    For removing templates you could try the [Obsolete] attribute?

    I haven't tried this myselt, but I know that this works for removing DocType properties.

    Thanks, Lee.

Please Sign in or register to post replies

Write your reply to:

Draft