问题
I have a Git repository which contains an ASP.net application and a PHP application, each in its own subdirectory under the root of the Git repository. I would like to create two websites in Azure websites and deploy each of these applications to one of those websites. I can deploy the ASP.net application with no problem by setting the project variable in the settings panel on the website properties to the path to the CS project file. However I cannot successfully get the PHP site to deploy. I have tried setting the WWWroot directory, but Azure is still trying to build the csproj file even though it is not specified by the variable on that website, nor is it present in the root directory of the Git repository. How can I make the PHP site deploy correctly, without needing to put it in its own repository?
回答1:
Figured it out: I just set the "Project" attribute in app settings to the directory name of the PHP application, relative to the root of the repo.
回答2:
In case it helps, I used to do this on a number of my projects, but have since migrated to a new strategy.
Now, I create a git repository for my overall project and repositories for each of the "sub projects" within it. For my Tweet Monkey project, for instance, I have 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.
Then I link the sub projects into the main project using submodules by typing the following at the command prompt...
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
That way I can deploy the website to Azure using CI by simply tying up to the tweetmonkey.io repository, but I can also clone the entire project or point other people to the entire project using the http://github.com/codefoster/tweetmonkey link.
Hope that helps.
来源:https://stackoverflow.com/questions/28639979/how-do-i-deploy-a-php-site-to-azure-websites-from-a-subdirectory-of-a-git-reposi