简体   繁体   English

从 yaml 管道任务访问已发布的工件

[英]Accessing Published Artifacts from yaml pipeline tasks

I have a PowerShell task that processes published artifacts from another stage.我有一个 PowerShell 任务,它处理从另一个阶段发布的工件。

I have noticed these are put into a folder "s".我注意到这些被放入文件夹“s”中。 Random sampling shows its "s" all the time but I doubt if it will be the case always!随机抽样一直显示它的“s”,但我怀疑它是否会一直如此!

Wondering what's the best way to refer to these files safely?想知道安全引用这些文件的最佳方法是什么?

Here's my publish artifacts task:这是我的发布工件任务:

发布任务

Published artifacts:发布的工件:

已发布的工件

And the PowerShell task that consumes these artifacts:以及使用这些工件的 PowerShell 任务:

在此处输入图像描述

The predefined variable you are looking for is $(System.DefaultWorkingDirectory).您要查找的预定义变量是 $(System.DefaultWorkingDirectory)。 Please refer to the documentation to see this variables definition请参阅文档以查看此变量定义

The variable that you use does not work with the s folder.您使用的变量不适用于s文件夹。 As described on the documentation Build.ArtifactStagingDirectory is the local path on the agent where any artifacts are copied to before being pushed to their destination.如文档Build.ArtifactStagingDirectory中所述,是代理上的本地路径,任何工件在被推送到目的地之前都会复制到该路径。 For example: c:\agent_work\1\a .例如: c:\agent_work\1\a You will find those files under a folder.您将在文件夹下a这些文件。 The folder that is referred with the s letter is where the sources are downloaded Build.SourcesDirectory .带有s字母的文件夹是下载源代码的地方Build.SourcesDirectory

https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml

Documentation on Azure devops predfined variables that can be used and where the folders are located. Azure 上的文档开发了可以使用的预定义变量以及文件夹所在的位置。

https://blog.geralexgr.com/devops/how-azure-devops-pipelines-agent-works https://blog.geralexgr.com/devops/how-azure-devops-pipelines-agent-works

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

相关问题 yaml 管道任务是开源的吗? - Are yaml pipeline tasks opensource? 从 Azure Function 访问 Devops Azure Pipeline Artifacts - Accessing Devops Azure Pipeline Artifacts from from Azure Function 请参阅使用 YAML 管道在 Azure DevOps 中构建工件 - See Build Artifacts in Azure DevOps with YAML Pipeline 想要从 azure devops 构建管道中的已发布工件中读取 xml 文件 - Want to read xml file from published artifacts in azure devops build pipeline 如何在 azure 管道版本中检查已发布管道工件的可用性 - How to check availability of Published Pipeline Artifacts in azure pipeline release 如何在 CD 管道中使用 CI 管道发布的工件 - How to consume artifacts published by CI pipeline in CD pipeline 从 yaml 管道中的不同组织访问 Azure 变量组 - Accessing an Azure variable group from a different organization in a yaml pipeline 使用从 UI 资源中选择的工件手动运行 YAML 构建管道将被忽略 - Running a YAML build pipeline manually with artifacts selected from resources in the UI are ignored 我们如何配置以从基于 yaml 的 azure CI 管道的 Jfrog 工件中提取 npm 包? - how can we configure to pull npm packages from Jfrog artifacts for yaml based azure CI Pipeline? 如何删除我的构建管道发布的工件? - How do I delete the artifacts published by my build pipeline?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM