Copied to clipboard

Flag this post as spam?

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


  • Robert J. Bullock 386 posts 405 karma points
    Oct 22, 2018 @ 15:06
    Robert J. Bullock
    0

    Publish Models to Private Nuget Server

    I am not sure where to share this idea, but I would love it if Umbraco could be setup to publish models to a private Nuget server. Then I could add and update my models in my project(s) using Nuget. I often have a few projects that would need references to my Umbraco models.

    I suppose git would work as well.

    Has anyone thought about this or tried it?

  • Nik 1591 posts 7148 karma points MVP 6x c-trib
    Oct 22, 2018 @ 15:12
    Nik
    0

    Hi

    What Models Builder mode are you using? Also, how many steps would be acceptable for you to achieve this?

    Nik

  • Robert J. Bullock 386 posts 405 karma points
    Oct 22, 2018 @ 15:17
    Robert J. Bullock
    0

    I'm using Dll mode. It would be great if you could configure your Nuget server info in the back office and then just click a button and your Nuget package is updated. Then you just update in the packages in your Visual Studio projects. Make sense?

  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    Oct 22, 2018 @ 16:42
    Søren Gregersen
    0

    Are all your umbraco sites 100% identical?

    I haven't worked on sites that share anything other than property editors.

  • Robert J. Bullock 386 posts 405 karma points
    Oct 22, 2018 @ 17:31
    Robert J. Bullock
    0

    No, I don't mean that I would share the generate models between different sites, but rather between different projects for the same site. I often use at least two projects for each website: one class library to hold my custom controllers, models, etc. and the website. So it'd be easier to keep these in-sync.

  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    Oct 22, 2018 @ 18:06
    Søren Gregersen
    0

    how about just generating them in another project?

    https://github.com/zpqrtbnk/Zbu.ModelsBuilder/wiki/Install-And-Configure

    Set Umbraco.ModelsBuilder.AcceptUnsafeModelsDirectory to true, change the Umbraco.ModelsBuilder.ModelsNamespace to fit your project, and point Umbraco.ModelsBuilder.ModelsDirectory to a folder in your project.

  • Robert J. Bullock 386 posts 405 karma points
    Oct 22, 2018 @ 20:42
    Robert J. Bullock
    0

    Well, that might work but as I'm generating the models (in Dll mode) on the remote server, I thought it would be convenient to update them on my development machine, all the projects in one go. Granted, it's usually just two projects...

    So basically, I'm suggesting a model builder that publishes to a remote code repository that can then be referenced in Visual Studio. With that setup, your suggestion would work perfectly.

  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    Oct 23, 2018 @ 04:17
    Søren Gregersen
    0

    I have never heard of a workflow like that.

    Do you download the generated modelfiles? What happens if you make changes to doctypes locally?

  • Robert J. Bullock 386 posts 405 karma points
    Oct 23, 2018 @ 12:49
    Robert J. Bullock
    0

    Yes, I download the generated models. I don't change the doctypes locally once a project is deployed. I would regenerate them on the server then update the Dll in my project(s).

  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    Oct 23, 2018 @ 13:43
    Søren Gregersen
    0

    I really think you should follow a more “normal” workflow, wich allows you to benefit from the features the tools provide you :-)

    But, you could always have Umbraco ship the generated file to Git, and then setup a CI/CD that builds/publishes a DLL that you can use.

    I just really think it would be much more simple to just use modelsbuilder on your local machine, and then push changes when they are ready.

Please Sign in or register to post replies

Write your reply to:

Draft