如何从另一个 job2 访问 Hudson job1 工件?
我们在哈德逊的一个项目中有一份制作工作和一份夜间工作。生产作业需要从特定的夜间构建#(作为参数提供)中提取一些工件。谁能帮助我们提示如何实现这一目标?
We have a production job and a nightly job for a project in Hudson. The production job needs to pull off some artifacts from a specific nightly build # (which is provided as parameter). Can anyone help us with a hint on how to achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Copy Artifact 插件似乎能够做到这一点。
另一种方法可能是通过获取工件
The Copy Artifact plugin seems to be capable of doing this.
Another approach could be to fetch the artifact via
您可以使用作业配置页面中的“构建环境”配置工具。勾选“配置 M2 额外构建步骤”框并添加一个执行 Shell,用于从所需工件中 grep 内容。
You can use "Build Environment" configuration tools in the job's configuration page. Tick the Configure M2 Extra Build Steps box and add an Execute Shell which grep things from the desired artifact.
我们有类似的需求并使用以下系统常规:
这会创建一个
VARIABLE_NAME
,其中包含来自ArtifactJobName
的工件名称,我们使用它,因为它们都存储在特定文件夹中。我不确定如果您有多个工件会发生什么,但似乎您可以从工件数组中获取它们。您可以使用 getLastSuccessfulBuild 来防止当前正在构建另一个 ArtifactJobName 且您获取的数组为 null 时出现问题。
We have similar need and use the following system groovy:
This creates a
VARIABLE_NAME
with the artifact name in it fromArtifactJobName
, which we use since they are all stored in a specific folder. I am not sure what will happen if you have multiple artifacts, but it seems you could get them from the artifacts array.You could use
getLastSuccessfulBuild
to prevent issue when anotherArtifactJobName
is being build at the moment and you get array with null.