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.
Is that the way to go and then add "*.Web" project to UaaS repositoy and add the complete solution to source control repository?
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.
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)?
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?
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));
});
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.
Is that the way to go and then add "*.Web" project to UaaS repositoy and add the complete solution to source control repository?
/Bjarne
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.
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
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?
We have some new documentation for this too: https://our.umbraco.org/documentation/Umbraco-as-a-Service/Set-Up/Visual-Studio/
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?
No YOUR repository should not contain the *.Web, that's why we put it in the .gitignore by default.
Okay, thanks for clarifying this :)
@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:
Cheers to you both!
is working on a reply...