简体   繁体   English

如何在 Azure Devops 中相同管道的两个版本之间共享文件?

[英]How to share a file between two builds of same pipeline in Azure Devops?

I've recently started using Azure DevOps & I want to store a .json file generated during one nightly scheduled build run somewhere so that when the nightly scheduled build runs next time for the same pipeline, I should be able to use that stored json file in this current build run.我最近开始使用 Azure DevOps 并且我想在某处存储一个在每晚安排的生成运行期间生成的 .json 文件,以便当下次为同一管道运行每晚安排的生成时,我应该能够使用该存储的 json 文件在当前的构建运行中。 I've tried Publish and Download Pipeline Artifacts task but it ask me to specify the specific build from where the artifacts should be downloaded which in my case is not possible to specify as there are multiple Individual CI builds that happens throughout the day between those nightly scheduled build.我已经尝试过发布和下载管道工件任务,但它要求我指定应该从哪里下载工件的特定构建,在我的情况下,这是不可能指定的,因为在那些夜间之间全天发生了多个单独的 CI 构建预定的构建。

You could use a pipeline tag to identify the right build:您可以使用管道标签来识别正确的构建:

  1. At the end of the nightly scheduled build, make it tag itself as "nightly" eg with a powershell task calling build.addbuildtag在每晚计划的构建结束时,将其自身标记为“每晚”,例如使用调用build.addbuildtag的 powershell 任务
  2. The next nightly build can identify the previous one by this tag and download the artefact it needs:下一个 nightly build 可以通过这个标签识别前一个,并下载它需要的 artefact
    - task: DownloadPipelineArtifact@2
      inputs:
        source: 'specific'
        project: 'FabrikamFiber'
        pipeline: 12
        runVersion: 'latest'
        tags: 'nightly'

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从 Azure DevOps 管道读取 Azure 文件共享文件 - How to Read Azure File Share Files from Azure DevOps Pipeline 如何将多个 json 文件导入/上传到 Azure Devops Pipeline Builds? - How to import/upload multiple json files to Azure Devops Pipeline Builds? 如何从 Azure DevOps 管道将多个发布或构建导出到桌面? - How to export multiple Release or Builds from Azure DevOps Pipeline to desktop? 将 azure 文件共享挂载到 azure devops 管道非常慢 - Mounting of azure file share to azure devops pipeline is very slow 如何通过邮件分享 azure devops 管道的构建失败原因? - How to share build failure reason of azure devops pipeline through a mail? 在 azure DevOps 中将构建从一个管道复制到另一管道 - Copy Builds from one pipeline to other pipeline in azure DevOps 如何将多个 json 文件导入/上传到 Azure Devops Pipeline Release and Builds? - How to import/upload multiple json files to Azure Devops Pipeline Release and Builds? Azure DevOps 管道定义:如何在 GUI 和 yml 视图之间切换 - Azure DevOps Pipeline Definitions: How to switch between GUI and yml views 如何在 azure devops 管道中发布 testNG 报告? 有相同的扩展名吗? - How to publish the testNG reports in azure devops pipeline ? is there any extensions for same? 如何在发布管道中的 Azure DevOps 中输出 terraform 输出文件 - How to output terraform output file in Azure DevOps in release pipeline
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM