Jenkins 使用 OctoPack 和 ReadyRoll 构建警告“源文件不存在”

Posted

技术标签:

【中文标题】Jenkins 使用 OctoPack 和 ReadyRoll 构建警告“源文件不存在”【英文标题】:Jenkins build warnings "source file does not exist" with OctoPack and ReadyRoll 【发布时间】:2018-01-08 20:47:38 【问题描述】:

我正在尝试使用 ReadyRoll 设置 Jenkins 构建项目。大多数情况下它正在工作,但我收到了令我担心的警告:

  MSBUILD : OctoPack warning OCTNOENT: The source file 'c:\scm01-jenkins\workspace\DatabaseDeploys\DatabaseDeploys\CoreServices\bin\Release\' does not exist, so it will not be included in the package [c:\scm01-jenkins\workspace\DatabaseDeploys\DatabaseDeploys\CoreServices\CoreServices.sqlproj]
  MSBUILD : OctoPack warning OCTNOENT: The source file 'c:\scm01-jenkins\workspace\DatabaseDeploys\DatabaseDeploys\CoreServices\obj\Release\CoreServices_Package.sql' does not exist, so it will not be included in the package [c:\scm01-jenkins\workspace\DatabaseDeploys\DatabaseDeploys\CoreServices\CoreServices.sqlproj]

我搜索了有关此错误的信息,但没有发现任何有用的信息。当我在构建完成后检查构建服务器时,它说不存在的文件夹和文件确实存在。这对我来说意味着这里发生了某种顺序的操作错误,但我不知道会发生在哪里或如何发生。

这是生成警告的日志部分:

OctoPack:
  Using package version: 8.6.26
  OctoPack: OctoPack version: 3.6.1.0
  OctoPack: Written files: 10
  OctoPack: Copy file: c:\scm01-jenkins\workspace\DatabaseDeploys\DatabaseDeploys\CoreServices\obj\Release\CoreServices.nuspec
  OctoPack: Packaging a console or Window Service application (no Web.config detected)
  OctoPack: Add binary files
  OctoPack: Added file: CoreServices_Package.sql
  OctoPack: Added file: CoreServices_DeployPackage.ps1
  OctoPack: Added file: CoreServices_Snapshot.nupkg.bin
MSBUILD : OctoPack warning OCTNOENT: The source file 'c:\scm01-jenkins\workspace\DatabaseDeploys\DatabaseDeploys\CoreServices\bin\Release\' does not exist, so it will not be included in the package [c:\scm01-jenkins\workspace\DatabaseDeploys\DatabaseDeploys\CoreServices\CoreServices.sqlproj]
  OctoPack: Added file: Deploy.ps1
  OctoPack: Added file: DeployFailed.ps1
MSBUILD : OctoPack warning OCTNOENT: The source file 'c:\scm01-jenkins\workspace\DatabaseDeploys\DatabaseDeploys\CoreServices\obj\Release\CoreServices_Package.sql' does not exist, so it will not be included in the package [c:\scm01-jenkins\workspace\DatabaseDeploys\DatabaseDeploys\CoreServices\CoreServices.sqlproj]
  OctoPack: Added file: CoreServices.dll
  OctoPack: Added file: CoreServices.pdb
  OctoPack: NuGet Version: 3.5.0.38733 (Custom build for OctoPack. See http://g.octopushq.com/VersioningInOctopusDeploy)
  OctoPack: Attempting to build package from 'CoreServices.nuspec'.
  OctoPack: Successfully created package 'c:\scm01-jenkins\workspace\DatabaseDeploys\DatabaseDeploys\CoreServices\obj\octopacked\IC_CoreServices.Database.8.6.26.nupkg'.

这里是 MSBuild 参数:

/t:Clean,Build /p:Version=8.6.26.0;Configuration=Release /p:GenerateSqlPackage=True /p:ShadowServer=[shadowdatabasename] /p:RunOctoPack=true /p:OctoPackPackageVersion=8.6.26 / p:OctoPackPublishPackageToHttp=http://[OctopusDeployServer]/nuget/packages /p:OctoPackPublishApiKey=[key]

任何想法如何解决这个问题?

谢谢。

【问题讨论】:

【参考方案1】:

不幸的是,这是 ReadyRoll 与 OctoPack 集成的一个已知问题,但警告是无关的,可以安全地忽略。

要禁止显示警告,请将以下内容添加到您的 MSBuild 参数中:

/nowarn:OCTNOENT

问题解决后我会更新这个答案 (1003)。

对此的修复已作为ReadyRoll 1.16.18100 的一部分发布;在构建期间不应再显示 OctoPack 警告。

【讨论】:

以上是关于Jenkins 使用 OctoPack 和 ReadyRoll 构建警告“源文件不存在”的主要内容,如果未能解决你的问题,请参考以下文章

.Net 2.0 和 msbuild 2.0 的 Octopack

OctoPack 和 OD 通道:如何创建可以通过管道传输到版本通道的包版本?

AppVeyor Octopack - GetAssemblyVersion 失败

MSBuild 在发布之前做 OctoPack

TFS2017 - 使用 octopack 凭据进行 NuGet 推送

是否可以将 OctoPack 与新的 PackageReference NuGet 格式一起使用?