简体   繁体   English

无法从 Github 子文件夹部署到 Azure 部署槽

[英]Can't deploy from Github Subfolder to Azure Deployment Slot

Edit:编辑:

Before reading everything below, I can be more succinct in asking why is Azure/KuduSync ignoring my .deployment file and how do I instruct the Kudu App Service to process the file?在阅读下面的所有内容之前,我可以更简洁地询问为什么 Azure/KuduSync 会忽略我的.deployment文件以及如何指示 Kudu 应用服务处理该文件?

I have written a Node.js/React project using Visual Studio 2017. When I link it to a GitHub repository, it copies the parent directory which contains the .sln file and the project folder containing the node.js application.我使用 Visual Studio 2017 编写了一个 Node.js/React 项目。当我将它链接到 GitHub 存储库时,它会复制包含.sln文件的父目录和包含node.js应用程序的项目文件夹。

The problem I'm running into is when I deploy the repository to my Azure deployment slot, Kudu copies the root of the GitHub repository containing the .sln file and the subfolder to the wwwroot folder.我遇到的问题是当我将存储库部署到我的 Azure 部署槽时,Kudu 将包含.sln文件和子文件夹的 GitHub 存储库的根目录复制到 wwwroot 文件夹。

When I browse to the Azure website, I have to go to the当我浏览到 Azure 网站时,我必须 go 到

[name].azurewebsite.net/[subfoldername] 

to access Index.html .访问Index.html

I have tried creating a .deployment file with the following configuration:我尝试使用以下配置创建.deployment文件:

[config]
project=[subfolder]

I have placed this in the root of my GitHub repository.我已将它放在我的 GitHub 存储库的根目录中。 When I try to deploy, KuduSync ignores the .deployment file.当我尝试部署时,KuduSync 会忽略.deployment文件。

I have also tried creating a "PROJECT" application setting pointing to the subdirectory and flagging it as a "Deployment slot setting" within my Azure web app slot.我还尝试在我的 Azure web 应用程序插槽中创建指向子目录的“项目”应用程序设置并将其标记为“部署插槽设置”。

None of these options have instructed Kudu to deploy directly from the subfolder rather than the root of the repository.这些选项都没有指示 Kudu 直接从子文件夹而不是存储库的根目录进行部署。

[Edit] This is the GitHub and Azure directory structure Snapshots of Directories [编辑] 这是 GitHub 和 Azure 目录结构 目录快照

[Here's the log from Azure. [这是来自 Azure 的日志。 As you can see it ignores the.deployment file]如您所见,它忽略了 .deployment 文件]

    Command: kudusync -v 50 -f /home/site/repository <br/>
-t /home/site/wwwroot <br/>
-n /home/site/deployments/[site]/manifest <br/>
-p /home/site/firstDeploymentManifest <br/>
**-i ".git;.hg;.deployment;.deploy.sh"** <br/>
Kudu sync from: '/home/site/repository' to: '/home/site/wwwroot' <br/>
**Ignoring: .deployment** <br/>
Copying file: '.gitattributes' <br/>
Copying file: '.gitignore' <br/>

I figured out that using the Continuous Deployment option in Azure prevents me from using a custom deployment file.我发现使用 Azure 中的持续部署选项会阻止我使用自定义部署文件。 Instead, I decided to create another repository in GitHub from my subfolder.相反,我决定从我的子文件夹在 GitHub 中创建另一个存储库。 This will allow me to us Azure CD/CI to write my project files directly to wwwroot.这将允许我通过 Azure CD/CI 将我的项目文件直接写入 wwwroot。 Thanks for all of your help.感谢您所有的帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM