TeamCity Artifacts; Exclude Individual Files

偶尔善良 提交于 2019-12-01 02:44:44
psych

I don't believe you can.

However, if you are using the artifacts in another build configuration as an artifact dependency, you can exclude a particular file there.

When you set up the dependencies, you can specify a negative operator like this:

+:release/**=>Dependencies/SomeProject
-:release/SomeBinary.dll

It is a horrible hack, but one way you could get it to work would be to set up a new build configuration which gets the dependencies as an artifact dependency, excluding the one binary, and then publishes its own artifacts.

As in, create a new build configuration and publish:

Dependencies/SomeProject=>release

Then reference the artifacts from this build configuration instead of the other one.

A little bit late for the party, but there is still no fix...

I ended up adding a last build step to the project. It is command line > custom script. Then I used this commands to remove the files that I didn't want in the artifacts. This runs just before artifacts collection.

del /S /Q "src\apps\*.xml" 
del /S /Q "src\apps\*.pdb"

Explanation for del command

/S  Delete from all Subfolders (DELTREE)
/Q  Quiet mode, do not give a Yes/No Prompt before deleting
 *  Match any characters
Vadzim

Our current options are to vote for this feature request at http://youtrack.jetbrains.com/issue/TW-5244 and fail back to workarounds.

TeamCity artifact paths combine folders question hints that the same target folder can be reused for multiple path patterns.

TeamCity docs also state that

TeamCity will create directories starting from the first occurrence of the wildcard in the pattern.

So in many cases it's possible to inverse exclusion problem to multiple inclusions.

For example, instead of lurking how to exclude -:**/.svn from my templates I was able just to filter them by extension:

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