How does deployment/publishing work?

Topics: Administration, Announcements, Customizing Orchard, General, Installing Orchard, Localization, Troubleshooting
Mar 24, 2011 at 6:24 PM

I understand the concept of nested web apps. Keeping essentially one web app, but with other projects that are web apps inside to keep a separation of code.

When I publish Orchard.Web, how does it know to also publish Orchard.Core (and the 20 others modules)?

Also, how does Orchard.Core's dll get outputted to Orchard.Web/bin/ ?  I understand why, but how?

Mar 24, 2011 at 8:52 PM

I have the same question, and it should be clarified that this only pertains to using the solution from the source. If you install via the web installer into webmatrix, deployment really isn't an issue. How to do you generate the project that is available to you with a WebMatrix install from the source code's solution file? It seems like there must be some msbuild or something around that does this.

Coordinator
Mar 24, 2011 at 10:39 PM

Physically, the modules live inside the Modules directory that is inside of the Orchard.Web folder. The solution file displays those alongside Orchard.Web for convenience, but that's logical, not physical. Modules are also MVC areas, for which there is an after build step that copies the binaries into the main site's bin.

All that you need to run the site (and all that the web installer file has) is the contents of the Orchard.Web folder (and that includes all modules and themes because that's just in a subdirectory of this.

Mar 25, 2011 at 11:40 AM

Perhaps there could be some clarification here.

The ClickToBuild.cmd in the source enlistment will correctly build the solution, and also delete any unneccessary dlls from the module directories. This produces a version that can be happily FTP'd to your web server (otherwise there could be hundreds of megabytes of dlls in the various module projects, which will take forever to upload - I think these are produced if you do a normal build from VS).

However I think the "Package/Publish" system in VS/VWD will fail in this regard. You can select "All files in this project folder" in the Package/Publish options. But I believe VS will build the entire project and all modules and attempt to upload everything - which will take hours on typical upload bandwidth. Also it will overwrite Settings.txt and Orchard.sdf in App_Data, both of which could be very problematic for publishing to a production server!

I read somewhere that the developer/deployment story is being improved for the coming release, is there any more information around on this?

At the moment my workflow for updating my hosted version is as follows;

- Create a "clean" source enlistment locally

- Use "ClickToBuild.cmd" to build for upload (in my case I have a dedi server so I can do this directly on the server and don't have to upload all those big .dlls!)

- Maintain a local source enlistment where I do development and testing

- Upload individual files when not much has changed - this is usually just css, templates, etc.

- If I've built or modified a module / theme, I use the command line packaging tool to build a .nupkg ... I can then install this to the server instance just like any other module.

This really isn't too bad for most purposes, although it'd be nice to have the Publish tool behave properly. It's also fairly complex multi-stage process to do any updates; package, log in to site, Dashboard > Modules, install module, select file, install, confirm features, possibly then have to click update. Maybe the Packaging module could simply have a "package push" command that would push a module to a server (requiring admin username/password obviously)

Also I've just noticed in latest 1.1 there's no longer an upload/install module option - where has that gone? I downloaded the modules from Gallery that I use regularly, so it was pretty quick to set up a new instance... The dashboard gallery interface can be quite slow! (Somewhat mitigated by the addition of paging but still...)

Mar 25, 2011 at 2:50 PM
Edited Mar 25, 2011 at 8:37 PM

Helps a lot, thanks... but I can't seem to find this ClickToBuild.cmd in the latest version - scratch that: apparently I was working with Orchard.Source.1.0.20.zip which did not contain the ClickToBuild.cmd

Mar 26, 2011 at 1:06 AM

How does all this happen when I publish inside of visual studio though? It is my understand that ClickToBuild.cms doesnt get called. Visual studio just builds from the ".csproj".

I am trying to setup the same setup when publishing for a solution I am working on.

Mar 26, 2011 at 1:22 AM

What I am saying is that you can't use Publish within Visual Studio.

However the WebMatrix Publish option might work (after you have run ClickToBuild).

Otherwise, just use FTP (following my bullet points above)

Mar 28, 2011 at 6:48 PM

ClickToBuild.cmd basically calls Build.cmd, which executes msbuild on the Orchard.proj build file. It will create a Build directory and in that directory will be a Stage directory,  which is pretty much what you want to deploy. As Mr. RandomPete said, you can't publish from Visual Studio. 

Mar 28, 2011 at 7:04 PM

Very interesting ... I hadn't even looked at the build folder ... was just deploying src/Orchard.Web after build! Thanks for that :)

Jul 12, 2011 at 11:54 PM

Where is this ClickToBuild.cmd file? I cannot find it in the source code archive I just download for 1.2.41?

Coordinator
Jul 13, 2011 at 10:22 PM

It's a bug that it was not included in the package. You can obtain the files from the source code tab on this site.