使用动态项目名称替代品复制工件构建步骤 [英] copy artifacts build step using a dynamic project name alternatives

查看:72
本文介绍了使用动态项目名称替代品复制工件构建步骤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一份工作,当它完成时(构建后操作)触发一个参数化的构建(作业A)

I have a job that when it finishes (Post build Actions) Triggers a parameterized build (Job A)

要触发的内部版本将一个名为foo的字符串参数设置为JOB_NAME的值

The build that is getting triggered sets a string parameter called foo for the value of JOB_NAME

如果我将项目名称设置为我要传递的变量(%foo%),则作业A"具有构建步骤以从另一个项目复制工件"

"Job A" has a build step to 'copy artifacts from another project' were I set the project name to the variable i'm passing (%foo%)

我可以确认%foo%获取正确的值,但是当执行构建步骤时,它无法替代变量

I can confirm that %foo% is getting the correct value however when the build step executes it fails to substitute the variable

这是我收到的错误消息 无法找到工件副本的项目:%foo%

This is the error message I'm getting Unable to find project for artifact copy: %foo%

我正在寻找替代方法来解决我的问题,这是 如何为另一个项目中的复制工件动态传递项目名称

I'm looking for alternatives to solve my problem which is How to pass dynamically project name for copy artifacts from another project

推荐答案

您是否检查了复制工件"构建步骤的帮助?如果单击项目名称字段旁边的问号,您将看到以下文本:

Did you check the help for Copy artifacts build step? If you click on the question mark next to the Project name field, you will see this text:

用于复制工件的源项目的名称.可能包含对$ PARAM之类的构建参数的引用(请注意,使用参数时,所有经过身份验证的用户都必须可以访问源项目;这会阻止使用参数来访问私有作业的工件)

Name of source project for copying of artifact(s). May contain references to build parameters like $PARAM (note that when a parameter is used, the source project must be accessible to all authenticated users; this prevents use of parameters to access artifacts of private jobs)

因此,您应该尝试使用$foo而不是%foo%.

So, you should try $foo instead of %foo%.

这篇关于使用动态项目名称替代品复制工件构建步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆