Minimatch exclude pattern in VSTS publish task

2019-09-02 04:45发布

问题:

I've been wrestling with getting this minimatch exclude pattern to work.

The **\src!(packages) pattern works as expected but I need to also exclude web.template.config files under the src directory. I've tried several things including **\src!(packages|Web.template.config)

Can anyone help or point me to a good way of troubleshooting this? I'm stuck.

回答1:

To get this to work,

  • I added the Copy Files task
  • Applied the minimatch filter to the Copy Files task
  • Used the Publish Task to copy the entire $(build.artifactstagingdirectory) directory.

The minimatch filter is as follows...

**/src/**/!(*eb.*emplate*.config)
!**/packages{,/**}