Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excluding files/folders from VSTS publish

We are using the new VSO/VSTS style build within TFS on premise, 2015 Update 1 as of yesterday.

During the publish build artifacts stage we want to copy all the files/folders from a root bar 2 sub folders.

ie:

$\somefilestopublish1\...
$\somefilestopublish2\...
$\somefilestoexclude1\...
$\somefilestoexclude2\...

Currently I have **\* as the contents argument which obviously will publish everything. I have tried appending ;-:<exclude_pattern> as suggested by a Google search but that just stopped all output and resulted in an empty folder.

Is there a way to use the minimatch expression to exclude folders or will I need to swap to explicitly selecting the folders to publish instead.

like image 357
themaninthesuitcase Avatar asked Dec 02 '15 11:12

themaninthesuitcase


People also ask

What does it mean to exclude a folder?

If you trust a file, file type, folder, or a process that Windows Security has detected as malicious, you can stop Windows Security from alerting you or blocking the program by adding the file to the exclusions list. Caution: Only do this for files that you're confident are safe.

How exclude folder from search VS code?

From the search function, click the ellipsis to show the files to include and files to exclude text boxes. Enter any files and folder to exclude (separated by commas). From menu choose File ➡️ Preferences ➡️ Settings ➡️ User/Workspace Settings and filter default settings to search .


2 Answers

Minimatch use "!" to exclude the given pattern. You could specify it with following format:

!(somefilestoexclude1|somefilestoexclude2)

Following is the example: With !(bin|obj), "bin" folder and "obj" folder under "WindowsFormsApplication1" folder are not copied to artifact. enter image description here

like image 83
Eddie Chen - MSFT Avatar answered Oct 16 '22 11:10

Eddie Chen - MSFT


!/$tf/** works for me. I've opted to shorten that to !/$*/**

http://www.globtester.com/ helped. The $ symbol doesn't have to be escaped despite conflicting guidance on msdn: https://msdn.microsoft.com/en-us/library/bb383819.aspx.

like image 32
Jason Vercellone Avatar answered Oct 16 '22 10:10

Jason Vercellone