Copied to clipboard

Flag this post as spam?

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


  • Craig100 1136 posts 2523 karma points c-trib
    Apr 16, 2016 @ 09:59
    Craig100
    0

    Does UaaS still need a separate GIT repo?

    Just trying out UaaS with a little test site before jumping in with a main client. I'd like to ask how people set their Visual Studio up. My sites usually have added code in either App_Code, classLib directories and Model and Controller directories. HQ seem to be telling me I need to have a two project set up, Web (for Umbraco) and Code (for the rest), which is fine, I can deal with that. But as I understand it, that means that the code in the "Code" project won't be committed to the UaaS GIT repo which kind of spoils a major UaaS selling point.

    How to people handle this? Do you have 2 repos for the same solution, the UaaS one and another? Do you put just the "Code" project code in the non-UaaS repo? Does this cause issues with bringing on team members? It doesn't seem right at all so I'm assuming I've majorly misunderstood something somewhere along the line.

    Any advice appreciated. Thanks.

    Craig

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Apr 16, 2016 @ 14:04
    Sebastiaan Janssen
    101

    I started answering this, it turned out to be long, so I've written you a blog post instead! ;-)

    https://cultiv.nl/blog/visual-studio-and-umbraco-as-a-service/

  • Craig100 1136 posts 2523 karma points c-trib
    Apr 16, 2016 @ 14:45
    Craig100
    0

    Great blog post, thanks. That has cleared quite a few things up :)

    I was given the uaas.cmd file yesterday and used it to set up. It was very easy. This is just a trial so I'm replicating my own, very simple site to get to grips with everything. However, two issues....

    1) I wasn't too sure about where to point my git client, so I pointed it at the one in myproject.Web and added a remote to my UaaS project git repo.

    2) The site needs Archetype so I installed it and it's Courier extension via NuGet into myproject.Web. It took ages and appeared to download umbraco.core.7.2.2 and loads of other stuff. The site ran locally ok so I created a few docTypes and dataTypes and a couple of pages and then uploaded.

    Things haven't been going well too well from then on. Attempting to view the project's back office in UaaS results in a YSOD :(

    I've no doubt made an utter mess of it (because I'm good at that). What should I do with the GIT client side of things? Your blog seems to say the .git and .gitIgnore files in the myproject.web project are for the .Core code. I'm a bit confused about that. Shouldn't that be the UaaS git files and other ones be in the .Code project or have I got that wrong?

    As for NuGet installs, should I have installed into the .Core project?

    Thanks,

    Craig

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Apr 16, 2016 @ 15:02
    Sebastiaan Janssen
    0

    Just to note I updated the UaaS.cmd process while writing this to be ahead of some questions. So the additional git / gitignore stuff is new as of this afternoon.

    1. Not sure what that means? In the .Web project, the remote already points to the UaaS project git repo :-)
    2. Ah yes, well there's a good caveat and certainly something to improve for a future version of this script. Since the .Web project was not installed using NuGet, you can not install NuGet packages in it. This is the feedback we really want to get, great!

    So for now the advise is: use "normal" Umbraco packages to install plugins into Umbraco. I'll see if I can do a proper NuGet install of the .Web project as well but I suspect that will be another few weeks of tinkering to get it right. ;)

    So yes, now you've made a bit of a mess, not to worry if it's a trial project. It's nice that it's easy to start over (delete the site in the portal, create a new one, done).

    Yes, I understand it's a bit of a bending of the mind to figure out the two repos:

    • YourName.Web contains a .git folder, which is your UaaS deployment git repository. Anything you add here and push to UaaS gets deployed to UaaS.
    • The folder above that ALSO contains a .git folder, which is where your custom code and VS files go. This one, you will need to share with your team using your own git server.

    Note in the screenshot below that the paths point to the same folder and the .Web is just a subfolder in your code repo (it's in the gitignore so any changes you make in .Web don't appear in your custom code repo, that way they're isolated from each other but can still exist in the same folder to keep a nice overview). Maybe that's something that needs to change to to make the mental model easier.

    enter image description here

  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Jul 29, 2016 @ 14:59
    Jesper Ordrup
    0

    Hi Seb and craig

    So I just cloned a project using uaas.cmd. Then I installed vorto into the .core project as suggested in 2)

    It doesnt get copied to .web project. Whats the logic ?

    How will that work - I mean some nuget packages might create a lot of files. Will this be transferred to .web?

    Best

    Jesper

  • Craig100 1136 posts 2523 karma points c-trib
    Apr 16, 2016 @ 15:18
    Craig100
    0

    Great answers Sebastiaan, thank you again.

    My item 1) git issue happened because the script did all the downloading but I still needed to manually open the repo in SmartGit. Anyway, I know now.

    Glad I can start from scratch again without having to trouble the "Help" guys at HQ.

    Regarding the screenshots, I think it's fine as you have it.

    Cheers,

    Craig

  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Jul 29, 2016 @ 15:46
    Jesper Ordrup
    1

    What I understand from the twits of today with Sitereactor and Cultiv is the following:

    Read these:

    So this seems to be my understanding

    In general you can install nuget packages into both .core and .web. You should install into .core if you need to reference them from code in .core. You should install into .web if the nuget package contains more than .dll.

    Questions

    1. Is the above understanding correct?
    2. Do we still need to use uaas.cmd and create a .core project if we only install into .web?

    Thanks

    Jesper

    ps. suggestion rename .core to .code - nothing core there :)

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Aug 01, 2016 @ 06:28
    Sebastiaan Janssen
    2

    I had no access to a laptop over the weekend so my tweets have been a bit short. Let me elaborate:

    First of all: UaaS.cmd is just there to give the most people a Happy Path experience.

    There's nothing proprietary about the setup and what it does:

    1. We clone the Git repository git clone https://your-uaas-site.s1.umbraco.io
    2. We look in your web.config and figure out what version of Umbraco you're using
    3. We ask NuGet for the UmbracoCms package and to give us all the dependencies.
    4. We go through all of the dependencies and see if they have dependencies, etc. etc.
    5. When we know all of the dependencies, we make a de-duplicated list of them and put that list in a packages.config file and restore them in the packages folder where Visual Studio will look for them by default - this packages.config file gets copied into both Site.Core and Site.Web
    6. We create the directory structure with a Site.Core and a Site.Web folder
    7. We create a Visual Studio csproj file in the Site.Core directory, using your chosen namespace (this is just an xml file in which we replace some placeholders)
    8. We create a Visual Studio Solution file in the root folder, which points to the Site.Core directory and sets it as a C# class project and it also points to the Site.Web directory and sets it as a Website Project (this is just a text file in which we replace some placeholders)
    9. We do a git init in the root folder and add a .gitignore file in which Site.Web is ignored (Site.Web already is it's own git repository, the deploy repository for your UaaS site).

    That's it! Now, because there is a packages.config file in the Site.Web folder, and that folder is now marked as being a Website Project in the sln file, you can install NuGet packages into the Website project.

    This was a long way of saying: if you want to do this yourself in a manual way: create a VS solution with a Website project and drop in the packages.config file.

    There's nothing secret going on here, and there's no limitations, that we know of, of using NuGet with UaaS sites.

    And, as this is just a suggested setup, yes, you can change names, delete the C# class project, etc.

    I've also updated the documentation with a note about it being a suggested setup, not a prescribed "you HAVE to do it this way" setup.

Please Sign in or register to post replies

Write your reply to:

Draft