azure-devops - 为什么此 Azure DevOps 管道发布失败?

标签 azure-devops azure-pipelines

这是一个构建没有错误的 ASP.NET Core 3.0 项目,但是当它触发管道发布到 Azure 应用服务时,它失败并出现以下错误:

2019-11-10T23:09:23.8008460Z ##[error]Error: No package found with specified pattern: D:\a\r1\a***.zip

修复发布管道需要做什么?管道版本正在将最新版本作为其工件。

enter image description here

最佳答案

假设

以下信息假定您是适当的 publishing your build artifact来自您的构建管道,并且您已将正确的构建工件添加到您的发布管道中。


在您的发布管道中,您已在 Artifacts 区域中指定了构建工件 enter image description here

将构建工件添加到发布管道时,您选择为其指定别名 Build Artifact。这意味着您的 .zip 文件至少(使用默认设置)将位于 $(system.DefaultWorkingDirectory)/Build Artifact//的某个子目录中p>

A new unique folder in the agent is created for every release pipeline when you initiate a release, and the artifacts are downloaded into that folder. The $(System.DefaultWorkingDirectory) variable maps to this folder.


To ensure the uniqueness of every artifact download, each artifact source linked to a release pipeline is automatically provided with a specific download location known as the source alias. This location can be accessed through the variable:

$(System.DefaultWorkingDirectory)\[source alias]

This uniqueness also ensures that, if you later rename a linked artifact source in its original location (for example, rename a build pipeline in Azure Pipelines or a project in Jenkins), you don't need to edit the task properties because the download location defined in the agent does not change.

The source alias is, by default, the name of the source selected when you linked the artifact source, prefixed with an underscore; depending on the type of the artifact source this will be the name of the build pipeline, job, project, or repository. You can edit the source alias from the artifacts tab of a release pipeline; for example, when you change the name of the build pipeline and you want to use a source alias that reflects the name of the build pipeline.

(来自一些丰富的 documentation

不要使用 ***.zip(这不是正确的通配符语法)搜索您的包,而是使用 Build Artifact/**/*.zip

  • ** 用于递归搜索目录
    • (我不知道是什么文件夹)
  • * 用于搜索路径的给定级别的一部分
    • 任何文件/文件夹
      • 以 (SomeFile.*) 开头
      • 以 (*File.zip) 结尾
      • 我认为包含 (*meFi*)

关于azure-devops - 为什么此 Azure DevOps 管道发布失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58793826/

相关文章:

azure - 根据 Azure Pipeline 中的输入 checkout 不同的存储库

azure - 无法通过管道从 azure 存储库触发 shell 脚本

azure-devops - 管理 Azure YAML DevOps Pipelines 中的依赖项

Azure DevOps : How to set group variable with if statement

c# - 如何在 Azure DevOps 发布管道中使用构建的 DLL 运行我的测试?

azure-devops - Visual Studio Team Services (VSTS) wiki 是否支持语法突出显示?

Azure 容器应用程序无法从不同订阅中存在的 Azure 容器注册表中提取镜像

java - 当java编译器输出错误时如何使管道失败

C++/CMake/azure DevOps 代码覆盖率和单元测试

azure - 从 Azure DevOps 导出测试结果