如何将 PHP 站点从 Git 存储库的子目录部署到 Azure 网站

How do I deploy a PHP site to Azure websites from a subdirectory of a Git repository

我有一个 Git 存储库,其中包含一个 ASP.net 应用程序和一个 PHP 应用程序,每个应用程序都位于 Git 存储库根目录下的自己的子目录中。我想在 Azure 网站中创建两个网站,并将这些应用程序中的每一个部署到其中一个网站。通过将网站属性设置面板中的项目变量设置为 CS 项目文件的路径,我可以毫无问题地部署 ASP.net 应用程序。但是我无法成功部署 PHP 站点。我已尝试设置 WWWroot 目录,但 Azure 仍在尝试构建 csproj 文件,即使该文件未由该网站上的变量指定,也不存在于 Git 存储库的根目录中。如何使 PHP 站点正确部署,而不需要将其放入自己的存储库?

明白了:我只是将应用程序设置中的 "Project" 属性设置为 PHP 应用程序的目录名称,相对于存储库的根目录。

如果有帮助,我曾经在我的许多项目中这样做,但后来迁移到新策略。

现在,我为整个项目创建了一个 git 存储库,并为其中的每个 "sub projects" 创建了存储库。例如,对于我的 Tweet Monkey 项目,我有 http://github.com/codefoster/tweetmonkey as well as http://github.com/codefoster/tweetmonkey-raspi, http://github.com/codefoster/tweetmonkey-edison, and the website at http://github.com/codefoster/tweetmonkey.io.

然后我 link 通过在命令提示符下键入以下内容,使用子模块将子项目添加到主项目中... git submodule add http://github.com/codefoster/tweetmonkey-raspi git submodule add http://github.com/codefoster/tweetmonkey-edison git submodule add http://github.com/codefoster/tweetmonkey.io 这样我就可以通过简单地绑定到 tweetmonkey.io 存储库使用 CI 将网站部署到 Azure,但我也可以克隆整个项目或使用 [=12= 将其他人指向整个项目] link。 希望对您有所帮助。