【问题标题】:How do I deploy a PHP site to Azure websites from a subdirectory of a Git repository如何从 Git 存储库的子目录将 PHP 站点部署到 Azure 网站
【发布时间】:2015-02-20 23:27:54
【问题描述】:

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

【问题讨论】:

    标签: php git azure azure-web-app-service azure-git-deployment


    【解决方案1】:

    想通了:我只是将应用程序设置中的“项目”属性设置为 PHP 应用程序的目录名称,相对于 repo 的根目录。

    【讨论】:

      【解决方案2】:

      以防万一,我曾经在我的一些项目中这样做,但后来迁移到了新策略。

      现在,我为我的整个项目创建了一个 git 存储库,并为其中的每个“子项目”创建了一个存储库。例如,对于我的 Tweet Monkey 项目,我有 http://github.com/codefoster/tweetmonkey 以及 http://github.com/codefoster/tweetmonkey-raspihttp://github.com/codefoster/tweetmonkey-edisonhttp://github.com/codefoster/tweetmonkey.io 的网站。

      然后我通过在命令提示符下键入以下内容,使用子模块将子项目链接到主项目... 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 这样,我可以使用 CI 将网站部署到 Azure,只需绑定到 tweetmonkey.io 存储库,但我也可以克隆整个项目或使用 http://github.com/codefoster/tweetmonkey 链接将其他人指向整个项目。 希望对您有所帮助。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2014-01-17
        • 2015-10-27
        • 1970-01-01
        • 2018-07-15
        • 2019-01-30
        • 1970-01-01
        • 2011-11-24
        相关资源
        最近更新 更多