VS Team Services and Azure Continuous delivery subdirectory

☆樱花仙子☆ 提交于 2020-01-03 09:04:34

问题


I have a project in VS Team Services git repository with the following structure (simplified):

  • /
    • scripts (for typescript)
    • styles (for sass)
    • wwwroot (public directory with images, css, js...)
    • ...

All typescript and sass files are built with gulp into appropriate directory inside wwwroot.

What I'd like to do but can't find how, push only wwwroot directory to Azure Website instead of entire project.

If not possible, what are alternatives?


回答1:


There are two ways you could do this

The Easier Way

You can add a custom deployment setting that sets your wwwroot directory as the root directory for your site.

The bottom part of this post describes how to do this: http://www.zainrizvi.me/2015/10/13/deploy-statically-generated-sites-to-azure-web-apps/

Here's the relevant snippet:

Add a .deployment file to the root folder of your code and paste the below inside:

[config] project = wwwroot

The Harder Way

If you really wanted to just deploy the wwwroot folder, you could use Custom Deployment Scripts to deploy just the desired files to your site.

This involves creating a custom script that executes every time you deploy your site, and in that script you'll tell it to copy just the wwwroot folder over.



来源:https://stackoverflow.com/questions/33495670/vs-team-services-and-azure-continuous-delivery-subdirectory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!