在下载PipelineArtifact步骤中引用管道无法使用吗?
我尝试通过两种不同的步骤下载特定的工件时尝试了两种不同的尝试来参考正确的管道。而且似乎无法使它起作用。
这是第一种方式,将以我见过的最奇怪的方式错误。当选择运行本身时,管道将显示“未决”,但是当回到一个级别以查看整个管道时,它会显示一个红色X,好像运行失败了,但是当试图挖掘它时,我可以得到没有输出。
#attempt 1
- download: $(PIPELINE_NAME)
第二种方式将成功下载< 1秒的软件包。...这意味着它实际上并非下载任何内容。下一步将失败,因为找不到软件包。
- task: DownloadPipelineArtifact@2
name:
displayName: 'Download artifact test'
inputs:
buildtype: specific
project: <project name here>
pipeline: '$(PIPELINE_NAME)' #this just doesnt work for some reason
runVersion: specific
runId: $(resources.pipeline.$(PIPELINE_NAME).runID)
downloadPath: $(Pipeline.Workspace)
这不是要工作吗?这些都无法解决变量,并且会失败。有人还有其他建议吗?这些需要硬编码吗?还是我错过了一些语法?我们有几个几乎相同的微服务,如果可以的话,我想在它们之间共享相同的模板。
I have tried 2 different attempts to reference the correct pipeline when downloading specific artifacts via two different built in steps. and cannot seem to get it to work.
This first way, will error in the oddest way i have ever seen. the pipeline will show 'pending' when selecting the run itself, but when going back one level to view the pipeline as a whole it will show a red x as if the run has failed, but when trying to dig into it, I can get no output.
#attempt 1
- download: $(PIPELINE_NAME)
And this second way will successfully download the package in <1sec.... meaning it isnt actually downloading anything. the next step will fail as no package is found.
- task: DownloadPipelineArtifact@2
name:
displayName: 'Download artifact test'
inputs:
buildtype: specific
project: <project name here>
pipeline: '$(PIPELINE_NAME)' #this just doesnt work for some reason
runVersion: specific
runId: $(resources.pipeline.$(PIPELINE_NAME).runID)
downloadPath: $(Pipeline.Workspace)
Is this just not meant to work? neither of these will resolve the variables and will fail. Anyone have any other suggestions? do these NEED to be hard-coded? or am I missing some syntax? We have several nearly identical micro-services that i would like to just share the same template between them if I could.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据参数文档下载管道工件任务,管道参数的值应为构建管道的定义 id ,而不是源名称。因此,这可能是您的参数不起作用的原因。
要从另一个管道下载工件,您无需指定管道资源。这是我从另一个管道下载工件的方法:
首先,在我以前的管道中,我有一个发布管道伪像任务:
然后,在另一个管道中,我有一个下载下载管道伪像task task :
tip:提示:
您可以单击任务上方的“设置”,如果您不需要使用变量,则可以使用UI填写信息。 UI将生成项目,管道的选择列表,... 。
According to the arguments document of Download Pipeline Artifacts task, the value of pipeline parameter should be the definition ID of the build pipeline, not the source name. So this may be the reason that your parameter doesn't work.
To download artifact from another pipeline, you don't need to specify pipeline resources. This is my method of downloading artifacts from another pipeline:
Firstly, in my previous pipeline, I have a Publish pipeline artifact task:
And then, in another pipeline, I have a Download Pipeline Artifacts task:
Tip:
You can click on "settings" above the task and fill in the information with UI if you don't need to use variables. UI will produce picklists of projects, pipelines, ... that you can choose.