git - 通过 GIT 将 Orchard.Source 部署到 Azure

标签 git azure nuget orchardcms azure-web-app-service

更新根据迄今为止给出的答案,这个问题已经演变并扩展了。

我想要两件事:(1) Visual Studio 作为我的 Orchard 开发环境,(2) GIT 作为我推送到 Azure 的方法。为了实现这一目标,我下载了 Orchard.Source 发行版而不是 Orchard.Web 发行版。

因此,我使用 GIT 将 Orchard.Source.1.5.1 发行版从本地计算机上的存储库发布到 Azure 网站(预览技术)。部署成功了,但随后在 Azure 上的构建失败了,因为它无法确定哪个解决方案是它应该构建的“那个”:

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.

该转储中列出的第一个解决方案 Azure 是它应该使用的解决方案。我如何将其告知 Azure?

在 David Ebbo 的帮助下,我现在明白我问了错误的问题:

  1. 问题已通过“.deployment”配置文件解决,
  2. 指向“正确”的 Visual Stuio 解决方案是不正确的!要通过 GIT 部署到 Azure,我必须指向一个项目文件(在本例中为 Orchard.Web.csproj):

    [配置]
    项目 = src/Orchard.Web/Orchard.Web.csproj

这让我更进一步,但我的下一个问题是我故意从我的 GIT 存储库中省略了 Orchard.Source 的“lib”文件夹。我错误地认为,如果我为 Orchard.sln 启用“nuget 恢复”,Azure 中项目文件的构建将获取所需的依赖项。

在 Sebastien 的帮助下,我现在了解到启用 nuget 可能是一场艰苦的战斗,因为 Orchard 团队对一些 Orchard 3rd 方依赖项进行了源代码级自定义。简而言之,如果我想快速启动并运行 Orchard.Source 发行版 - 那么我只需将“lib”文件夹提交到我的 GIT 存储库中(该死!)。

当我通过 GIT 进行下一次推送到 Azure 时,我的编译仍然失败 - 但至少错误数量大大减少了。我想它现在唯一不高兴的是:

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

如果我能克服这个问题,我最终可能会两全其美:Visual Studio 开发环境(由于 Orchard.Source 发行版)和支持 GIT 的 Azure 推送。有人知道最后一个问题可能是什么吗?

附: Orchard.Source 发行版中有一个“ClickToBuildAzurePackage.cmd”文件,该文件是在创建“GIT 推送到 Azure”之前创建的。这个小批处理文件尝试复制 GIT 推送到 Azure 现在提供的大部分工作。我可能会更多地探索该选项,但当然理想的情况是依赖新的 Azure 内置功能。<​​/p>

更新2:事实证明这只是因为lib/*/Castle Windsor 2.0/bin/*.gitignore 忽略。强制输入这些文件后,现在整个事情就构建和部署了!现在唯一的问题是当我访问该网站时该网站没有给出响应。如果有必要,我会将其变成一个单独的问题。事实上,我认为这个特定问题已经得到解答。

最佳答案

您可以使用存储库根目录下的 .deployment 文件指定要部署的项目。请参阅https://github.com/projectkudu/kudu/wiki/Customizing-deployments了解更多信息。

另请参阅https://github.com/AzureWebSites/OrchardCMS有关在 Azure 网站中运行的 Orchard 存储库的示例(但它有点过时)。

关于git - 通过 GIT 将 Orchard.Source 部署到 Azure,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12677574/

相关文章:

javascript - Git:如何在目录结构方面分离后端 Rest Api 和前端应用程序的版本控制?

azure - 无法获取标识符和最大值 CosmostDb

azure - 如何使用Azure应用服务/Web别名?

azure - 将安全组声明添加到自定义 Azure Active Directory 应用程序的 SAML token

git - 更改 git 远程源

git - 当 develop 分支与 master 有很大不同时管理修补程序?

git - 如何将相同的提交再次 merge 到 master?

c# - 如何在 .Net for Mac 中使用 appSettings

针对 Win10 和 Win8 设备的 Nuget 包

visual-studio - 在不覆盖现有事件的情况下添加构建后事件