Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy Orchard.Source to Azure via GIT

UPDATE this question has evolved and was expanded, based on the answers given so far.

I want two things: (1) Visual Studio as my Orchard development environment and (2) GIT as my means to push to Azure. To achieve this, I downloaded the Orchard.Source distro instead of the Orchard.Web distro.

So, I used GIT to publish the Orchard.Source.1.5.1 distro from a repository on my local machine to an Azure web site (preview technology). The deployment worked, but the subsequent build on Azure failed because it could not determine which solution was "the one" it should build:

remote: Unable to determine which solution file to build. C:\DWASFiles\Sites\MySite\VirtualDirectory0\site\repository\src\Orchard.sln, C:\DWASFiles\Sites\MySite\VirtualDirectory0\site\repository\src\Orchard.Azure\Orchard.Azure.sln, C:\DWASFiles\Sites\MySite\VirtualDirectory0\site\repository\src\Orchard.Azure\Orchard.Azure.Web\Modules\Orchard.ContentTypes\Orchard.ContentTypes.sln, C:\DWASFiles\Sites\MySite\VirtualDirectory0\site\repository\src\Orchard.Azure.Tests\Orchard.Azure.Tests.sln, C:\DWASFiles\Sites\MySite\VirtualDirectory0\site\repository\src\Orchard.Web\Modules\Orchard.ContentTypes\Orchard.ContentTypes.sln. remote: Error - Changes committed to remote repository but your website not updated.

The first solution Azure listed in that dump is the one it should be using. How do I tell that to Azure?

With help from David Ebbo, I now understand that I was asking the wrong question:

  1. the problem is solved with a '.deployment' configuration file and
  2. pointing to the "correct" Visual Stuio solution is incorrect! To deploy to Azure through GIT, I must point to a project file (in this case, Orchard.Web.csproj):

    [config]
    project = src/Orchard.Web/Orchard.Web.csproj

This gets me further along, but my next problem is that I intentionally omitted the 'lib' folder of Orchard.Source from my GIT repository. I figured, wrongly, that if I enabled "nuget restore" for the Orchard.sln, the build of the project files in Azure would fetch needed dependencies.

With the help of Sebastien, I now understand enabling nuget may be an uphill battle because some number of Orchard 3rd party dependencies have had source-level customizations by the Orchard team. In short, if I want to get up and running quickly with the Orchard.Source distro - then I need to simply commit the 'lib' folder into my GIT repository (darn!).

When I did my next push to Azure through GIT, my compilation still failed - but at least the number of errors were reduced dramatically. I think the only thing it is upset with now is this:

For OrchardFramework.csproj:
   Could not find assemblies: Castle.Core, Casstle.DynamicProxy2
   Missing type or namespace: Castle, AbstractLoggerFactory, DefaultProxyBuilder

If I can overcome this issue, I might finally have the best of boths worlds: a Visual Studio development environment (due to the Orchard.Source distro) and a GIT-enabled push to Azure. Anyone know what this last issue might be?

p.s. there is a "ClickToBuildAzurePackage.cmd" file in the Orchard.Source distro, which was created before the "GIT push to Azure" was created. That little batch file attempts to duplicate much of the work that a GIT push to Azure now offers. I may explore that option more, but of course the ideal situation would be to rely on the new Azure built-in capabilities.

UPDATE 2: It turns out this is simply because lib/*/Castle Windsor 2.0/bin/* is being ignored by .gitignore. Having forced those files in as well, the whole thing now builds and deploys! Only issue now is the site does not give a response when I visit it. I'll turn that into a seperate question if necessary. As is, I consider this particular question answered.

like image 950
Brent Arias Avatar asked Oct 01 '12 16:10

Brent Arias


Video Answer


2 Answers

You can specify a project to deploy using a .deployment file at the root of your repo. See https://github.com/projectkudu/kudu/wiki/Customizing-deployments for more info.

Also, see https://github.com/AzureWebSites/OrchardCMS for an example of an Orchard repo that works in an Azure Web Site (but it's a bit outdated).

like image 62
David Ebbo Avatar answered Sep 19 '22 00:09

David Ebbo


Orchard is not using Nuget for its dependencies, which means the libraries are checked in into the source control system, and you need them if you deploy by source.

There is a very good tutorial on installing Orchard on Windows Azure Web Sites using Git Publishing by David Hayden: http://www.davidhayden.me/blog/git-publishing-orchard-cms-to-windows-azure

like image 28
Sébastien Ros - MSFT Avatar answered Sep 20 '22 00:09

Sébastien Ros - MSFT