質問

Question:

I would like to exclude certain files (by type) from my Azure Websites deployment. Can this be done without creating a custom deployment file?

Given:

  • Deploying an MVC 4 web application from a local Git repository
  • Want to exclude *.coffee (CoffeeScript) files from the site deployment, but not from my Git repo
  • Scoured the Kudu wiki (https://github.com/projectkudu/kudu/wiki), but haven't found an answer
役に立ちましたか?

解決

I assume that these CoffeeScript files are listed in your csproj file, such that they show up in Visual Studio?

All you should have to do is make sure the Build Action is set to None and not to Content, and they won't get deployed.

他のヒント

A possible way to do this is through a post deployment action that runs a batch file like this

cd /d %HOME%\site\wwwroot
for /F "tokens=*" %%i in ('dir /s /b *.coffee') do del %%i

You can use an echo though first to make sure it's deleting the correct files

for /F "tokens=*" %%i in ('dir /s /b *.coffee') do echo %%i >> toBeDeleted.txt
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top