TeamCity 工件;排除单个文件 [英] TeamCity Artifacts; Exclude Individual Files

查看:23
本文介绍了TeamCity 工件;排除单个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 TeamCity 构建配置,其中包括用于发布工件的以下内容:

I have a TeamCity Build Configuration that includes the following to publish artifacts:

SourceBuilderinRelease*.dll=>release

这很好用,但是我想排除一个 dll(有很多)并且读过你可以使用 + &- 运营商这样做.大致如下:

This works fine, however I am wanting to exclude one dll (there are quite a few) and have read that you can use + & - operators to do this. Something along the lines of:

+: SourceBuilderinRelease*.dll=>release
-: SourceBuilderinReleaseBuilder.*

一旦我添加了这些,就不会发布任何工件,并且我在构建日志中收到以下错误(看起来它正在将 + 计为路径的一部分):

As soon as I add these in, no artifacts are published and I get the following error in the build log (looks like it is counting the + as part of the path):

[Publishing artifacts] Collecting files to publish [+:SourceBuilderinRelease*.dll=>release]
[Publishing artifacts] Artifacts path +:Source/Builder/bin/Release/*.dll not found

我使用的是 7.1.1 版本,任何人都有任何想法(我不确定这些运算符是否有效).我看到了一个使用 MSBuild 的解决方案,但很惊讶这个功能不可用.

I am using version 7.1.1, anyone any ideas (I am not sure whether these operators are even valid). I have seen a solution with MSBuild but am surprised this functionality is not available.

提前致谢.

推荐答案

我不相信你可以.

但是,如果您在另一个构建配置中使用工件作为工件依赖项,则可以在那里排除特定文件.

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

这是一个可怕的 hack,但您可以让它工作的一种方法是设置一个新的构建配置,将依赖项作为工件依赖项获取,不包括一个二进制文件,然后发布它自己的工件.

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.

这篇关于TeamCity 工件;排除单个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆