【问题标题】:TeamCity only publishing 1 package to NuGet feed when it should be publishing 4TeamCity 在应该发布 4 时仅将 1 个包发布到 NuGet 提要
【发布时间】:2018-12-18 00:21:13
【问题描述】:

我们有一个包含四个 NuGet Pack 构建步骤的构建配置。每个步骤都会创建一个 nuget 包作为工件,其中每个包都应发布到 TeamCity 托管的 nuget 提要。

对于这些文件的多达 59 个版本,这一切正常,但突然间,在第 60 次构建时,它现在只发布了 4 个包中的 1 个。

以下是最新成功构建中“Nuget Packages”选项卡的屏幕截图:

不幸的是,构建历史只显示了最新的 5 个构建,所以我无法显示生成这 4 个包的构建结果。

以下是构建配置的构建日志的一部分 - 它包含已发布包的日志和未发布包的日志:

[16:23:35]  Step 3/6: Publish Realex Package (NuGet Pack) (2s)
[16:23:36]  [Step 3/6] Cleaning output directory C:\BuildAgent\work\630c5944eee6eedd\Package
[16:23:36]  [Step 3/6] Cleaning C:\BuildAgent\work\630c5944eee6eedd\Package
[16:23:36]  [Step 3/6] pack: Create NuGet package from src\CompanyName.Payments.Realex\CompanyName.Payments.Realex.nuspec (1s)
[16:23:36]  [pack] NuGet command: C:\BuildAgent\plugins\nuget-agent\bin\JetBrains.TeamCity.NuGetRunner.exe C:\BuildAgent\tools\NuGet.CommandLine.4.1.0\tools\NuGet.exe pack C:\BuildAgent\work\630c5944eee6eedd\src\CompanyName.Payments.Realex\CompanyName.Payments.Realex.nuspec -OutputDirectory C:\BuildAgent\work\630c5944eee6eedd\Package -Version 1.0.64 -Properties Configuration=Release
[16:23:36]  [pack] Starting: C:\BuildAgent\temp\agentTmp\custom_script4808677879863245309.cmd
[16:23:36]  [pack] in directory: C:\BuildAgent\work\630c5944eee6eedd\src\CompanyName.Payments.Realex
[16:23:36]  [pack] JetBrains TeamCity NuGet Runner 2018.1.3580.0
[16:23:36]  [pack] Registered additional extensions from paths: C:\BuildAgent\plugins\nuget-agent\bin\plugins-4.0
[16:23:36]  [pack] Starting NuGet.exe 4.1.0.2450 from C:\BuildAgent\tools\NuGet.CommandLine.4.1.0\tools\NuGet.exe
[16:23:37]  [pack] Attempting to build package from 'CompanyName.Payments.Realex.nuspec'.
[16:23:37]  [pack] Successfully created package 'C:\BuildAgent\work\630c5944eee6eedd\Package\CompanyName.Payments.Realex.1.0.64.nupkg'.
[16:23:37]  [pack] WARNING: Issue found with package 'CompanyName.Payments.Realex'.
[16:23:37]  [pack] 
[16:23:37]  [pack] WARNING: Issue: Assembly outside lib folder.
[16:23:37]  [pack] WARNING: Description: The assembly 'lib/net45\CompanyName.Payments.Realex.dll' is not inside the 'lib' folder and hence it won't be added as reference when the package is installed into a project.
[16:23:37]  [pack] WARNING: Solution: Move it into the 'lib' folder if it should be referenced.
[16:23:37]  [pack] 
[16:23:37]  [pack] 
[16:23:37]  [pack] Process exited with code 0
[16:23:37]  [Step 3/6] Uploading created packages to build artifacts: CompanyName.Payments.Realex.1.0.64.nupkg
[16:23:37]  [Step 3/6] Publishing artifacts
[16:23:37]  [Publishing artifacts] Collecting files to publish: [C:\BuildAgent\work\630c5944eee6eedd\Package\CompanyName.Payments.Realex.1.0.64.nupkg => .]
[16:23:37]  [Publishing artifacts] Publishing 1 file using [ArtifactsCachePublisher]: Package/CompanyName.Payments.Realex.1.0.64.nupkg
[16:23:37]  [Publishing artifacts] Publishing 1 file using [WebPublisher]: Package/CompanyName.Payments.Realex.1.0.64.nupkg
[16:23:38]  Step 4/6: Publish Core Package (NuGet Pack) (1s)
[16:23:38]  [Step 4/6] Cleaning output directory C:\BuildAgent\work\630c5944eee6eedd\Package
[16:23:38]  [Step 4/6] Cleaning C:\BuildAgent\work\630c5944eee6eedd\Package
[16:23:38]  [Step 4/6] pack: Create NuGet package from src\CompanyName.Payments.Core\CompanyName.Payments.Core.nuspec (1s)
[16:23:38]  [pack] NuGet command: C:\BuildAgent\plugins\nuget-agent\bin\JetBrains.TeamCity.NuGetRunner.exe C:\BuildAgent\tools\NuGet.CommandLine.4.1.0\tools\NuGet.exe pack C:\BuildAgent\work\630c5944eee6eedd\src\CompanyName.Payments.Core\CompanyName.Payments.Core.nuspec -OutputDirectory C:\BuildAgent\work\630c5944eee6eedd\Package -Version 1.0.64 -Properties Configuration=Release
[16:23:38]  [pack] Starting: C:\BuildAgent\temp\agentTmp\custom_script8506009554571830270.cmd
[16:23:38]  [pack] in directory: C:\BuildAgent\work\630c5944eee6eedd\src\CompanyName.Payments.Core
[16:23:38]  [pack] JetBrains TeamCity NuGet Runner 2018.1.3580.0
[16:23:38]  [pack] Registered additional extensions from paths: C:\BuildAgent\plugins\nuget-agent\bin\plugins-4.0
[16:23:38]  [pack] Starting NuGet.exe 4.1.0.2450 from C:\BuildAgent\tools\NuGet.CommandLine.4.1.0\tools\NuGet.exe
[16:23:39]  [pack] Attempting to build package from 'CompanyName.Payments.Core.nuspec'.
[16:23:39]  [pack] Successfully created package 'C:\BuildAgent\work\630c5944eee6eedd\Package\CompanyName.Payments.Core.1.0.64.nupkg'.
[16:23:39]  [pack] WARNING: Issue found with package 'CompanyName.Payments.Core'.
[16:23:39]  [pack] 
[16:23:39]  [pack] WARNING: Issue: Assembly outside lib folder.
[16:23:39]  [pack] WARNING: Description: The assembly 'lib/net45\CompanyName.Payments.Core.dll' is not inside the 'lib' folder and hence it won't be added as reference when the package is installed into a project.
[16:23:39]  [pack] WARNING: Solution: Move it into the 'lib' folder if it should be referenced.
[16:23:39]  [pack] 
[16:23:39]  [pack] 
[16:23:39]  [pack] Process exited with code 0
[16:23:39]  [Step 4/6] Uploading created packages to build artifacts: CompanyName.Payments.Core.1.0.64.nupkg
[16:23:39]  [Step 4/6] Publishing artifacts
[16:23:39]  [Publishing artifacts] Collecting files to publish: [C:\BuildAgent\work\630c5944eee6eedd\Package\CompanyName.Payments.Core.1.0.64.nupkg => .]
[16:23:39]  [Publishing artifacts] Publishing 1 file using [ArtifactsCachePublisher]: Package/CompanyName.Payments.Core.1.0.64.nupkg
[16:23:39]  [Publishing artifacts] Publishing 1 file using [WebPublisher]: Package/CompanyName.Payments.Core.1.0.64.nupkg
[16:23:39]  Step 5/6: Publish GoCardless Package (NuGet Pack) (1s)
[16:23:41]  Step 6/6: Publish DirectDebitLogic (NuGet Pack) (1s)
[16:23:43]  Publishing artifacts
[16:23:43]  [Publishing artifacts] Collecting files to publish: [C:\BuildAgent\temp\buildTmp\nuget8440844446908059256packages\nuget.xml => .teamcity/nuget]
[16:23:43]  [Publishing artifacts] Publishing 1 file using [ArtifactsCachePublisher]: C:/BuildAgent/temp/buildTmp/nuget8440844446908059256packages/nuget.xml => .teamcity/nuget
[16:23:43]  [Publishing artifacts] Publishing 1 file using [WebPublisher]: C:/BuildAgent/temp/buildTmp/nuget8440844446908059256packages/nuget.xml => .teamcity/nuget
[16:23:43]  Publishing internal artifacts
[16:23:43]  [Publishing internal artifacts] Publishing 1 file using [ArtifactsCachePublisher]
[16:23:43]  [Publishing internal artifacts] Publishing 1 file using [WebPublisher]
[16:23:44]  Build finished

当我查看成功构建的构建日志时,它看起来完全一样。

注意:不知道为什么它会警告 dll 不在“lib”文件夹中,因为它在 lib\net45\ 中,并且在安装包时确实会引用 dll。

有什么想法为什么 TeamCity 可能突然只发布一个包而不是全部四个包?

我们正在使用 TeamCity Professional 2018.1(内部版本 58245)

【问题讨论】:

    标签: nuget teamcity


    【解决方案1】:

    自 2018.1(内部版本 58245)以来,我看到了同样的问题。我花了很长时间调查为什么我的构建行为不端。

    目前我已经将所有单独的 Pack 步骤压缩为一个。

    另一种解决方法是取消选择每个打包步骤的“发布创建的包以构建工件”复选框,然后将所有发布规则放入常规设置的“工件路径”中,如下所示:

    [发布输出目录]/[我的包].nupkg [发布输出目录]/[我的其他包].nupkg

    希望这会有所帮助,直到有可用的修复程序。

    【讨论】:

    • 此问题应在下一次更新 2018.1.1 中修复,同时应从问题 TW-55703 @youtrack.jetbrains.com/issue/的附件中获得快速修复>
    • 是的,所以最初我有两个“NuGet Pack”步骤,每个步骤都指定了一个单独的 nuspec 文件。通过浓缩,我只是在单个构建步骤中列出了“规范文件”中的所有 nuspec 文件,并作为临时措施禁用了其他构建步骤。
    • 我还发现,如果您指定通配符,通过常规设置发布将不起作用:(例如 [发布输出目录]/*.nupkg 会导致 35 个包中有 3 个未“发布”
    • 将 nuget pack 步骤压缩为一个步骤对我有用!显然,对于那些想要单独步骤的人来说,这仍然是一个问题。
    • 我可以确认 TW-55703 的临时修复在“解压缩”我之前的所有更改后解决了我的所有问题 :)
    猜你喜欢
    • 2014-12-21
    • 1970-01-01
    • 1970-01-01
    • 2020-01-30
    • 1970-01-01
    • 2015-07-12
    • 2012-05-12
    • 1970-01-01
    • 2021-04-08
    相关资源
    最近更新 更多