问题描述
我在VS Team Services git存储库中有一个具有以下结构(简化)的项目:
I have a project in VS Team Services git repository with the following structure (simplified):
- /
- 脚本(用于打字稿)
- 样式(无礼)
- wwwroot(包含图像,css,js ...的公共目录)
- ...
- /
- scripts (for typescript)
- styles (for sass)
- wwwroot (public directory with images, css, js...)
- ...
所有typescript和sass文件都是用gulp构建到wwwroot内的相应目录中的.
All typescript and sass files are built with gulp into appropriate directory inside wwwroot.
我想做的但找不到方法,仅将
wwwroot
目录推送到Azure网站,而不是整个项目.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?
推荐答案
有两种方法可以做到这一点
There are two ways you could do this
更简单的方式
您可以添加一个自定义部署设置,将您的wwwroot目录设置为站点的根目录.
You can add a custom deployment setting that sets your wwwroot directory as the root directory for your site.
这篇文章的底部描述了如何执行此操作: http://www.zainrizvi.me/2015/10/13/deploy-statically-generation-sites-to-azure-web-apps/
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/
以下是相关代码段:
[config] project = wwwroot
[config] project = wwwroot
艰难的道路
如果您真的只想部署wwwroot文件夹,则可以使用自定义部署脚本仅将所需文件部署到您的站点.
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.
这涉及到创建一个自定义脚本,该脚本在您每次部署网站时都会执行,并且在该脚本中,您将告诉它仅将wwwroot文件夹复制过来.
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.
这篇关于VS Team Services和Azure持续交付子目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!