Copied to clipboard

Flag this post as spam?

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


  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jun 23, 2016 @ 10:21
    Bjarne Fyrstenborg
    0

    VS structure when when locally with UaaS

    Hi..

    When working with UaaS locally in Visual Studio, what is the ideal way to structure to project in Visual Studio?

    I have had a look a Sebastiaans blog post here about UaaS https://cultiv.nl/blog/visual-studio-and-umbraco-as-a-service/ which point to a batch file, which clone the (deployment) repository in UaaS and create a web application project "MyProject.Core" and a web application website "MyProject.Web".

    We usually create a library/core project and a website project similar to the structure mentioned before. I the website project we also added an app folder (which contains static images, icons, less, javascript), a gulp folder and different config files in root of websites like gulpfile.js, bower.json and package.json, but we don't deploy these files - only the build outout in a "dist" folder located in root too.

    With UaaS as I understand it, the end-result should be in "*.Web" project, which are committed to UaaS deployment repository.

    So I have created a third project for gulp and bower, where output is built to "'.Web" project.

    enter image description here

    Is that the way to go and then add "*.Web" project to UaaS repositoy and add the complete solution to source control repository?

    /Bjarne

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Jul 04, 2016 @ 06:25
    Sebastiaan Janssen
    0

    Yep this looks correct, the *.App folder builds (using gulp I assume) to the *.Web\dist folder - those files will appear as new or changed in git and you can commit them to the UaaS git repository.

    Remember that we consider the UaaS gir repository as a "deployment repository" so whatever is in there will be deployed when you push to dev or when you deploy from dev to live using the UaaS portal.

  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jul 04, 2016 @ 06:35
    Bjarne Fyrstenborg
    0

    Yes, we are using gulp and I have configurated it to build to *.Web\dist folder, so it *.Web project just contains the bundled/compiled/minified js, css, icons etc. and also the compiled assemblies.

    And then you want to add all projects to (*.App, *.Core and *.Web) to source repository.. but usually not the *.Web/dist folder...

    Is it possible to ignore files in source repository, while adding them to deployment repository (UaaS)?

    /Bjarne

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Jul 04, 2016 @ 07:26
    Sebastiaan Janssen
    0

    Huh? *.Web is a separate repository that contains the files UaaS needs. That should not ignore the dist folder.

    You realize there's 2 repositories right?

    • Your code (*.App, *.Core and everything else that's not in *.Web)
    • The deployment repository, which is only *.Web - *.Web is 'gitignored' from the other repository (and should be).

    We have some new documentation for this too: https://our.umbraco.org/documentation/Umbraco-as-a-Service/Set-Up/Visual-Studio/

  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jul 04, 2016 @ 07:37
    Bjarne Fyrstenborg
    0

    I know UaaS should only contains the files in the *.Web project incl. /dist folder. I just wondered if the source repository also should contains the *.Web project. Today we have a library/core project and website project in source repository. All the Umbraco files lives in *.Web project, but when using UaaS you won't add those files to source repository too?

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Jul 04, 2016 @ 08:24
    Sebastiaan Janssen
    0

    No YOUR repository should not contain the *.Web, that's why we put it in the .gitignore by default.

  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jul 04, 2016 @ 09:26
    Bjarne Fyrstenborg
    0

    Okay, thanks for clarifying this :)

  • Jon R. Humphrey 164 posts 455 karma points c-trib
    Aug 10, 2016 @ 17:16
    Jon R. Humphrey
    0

    @Seb,

    Thanks for the brilliant UaaS.cmd file, it's perfect for what I've been trying to do! Once again I'm standing on the shoulders of giants!

    #h5yr!

    @Bjarne,

    Would you be willing to add your gulpfile.js to this thread as I'm trying to do the same with my static assets and I can't get gulp to copy the files to the destination folder?

    Here's mine:

    var gulp = require("gulp");
    var watch = require("gulp-watch");
    
    var source = "./*.App/css",
        destination = "./*.Web/css";
    
    gulp.task("watch-folder", function () {
      gulp.src(source + "/**/*.css", { base: source })
        .pipe(watch(source, { base: source }))
        .pipe(gulp.dest(destination));
    });
    

    Cheers to you both!

Please Sign in or register to post replies

Write your reply to:

Draft