简体   繁体   English

Jenkins 管道 groovy:如何获得另一个作业构建的工作区

[英]Jenkins pipeline groovy:how can I get the workspace of another job build

I have a job A using groovy code which manages multiple jobs like this:我有一个使用 groovy 代码的工作 A,它管理多个这样的工作:

def ret_b = build job:'Job B',parameters: [string(name: 'PROJECT', value: env.project_name)]

I need to use the workspace of job B in job A. Since each build of job B would create different workspaces such as workspace@2, I couldn`t hard code it in the pipeline groovy.Is it possible for me to get the workspace of job B?我需要在作业 A 中使用作业 B 的工作区。由于作业 B 的每个构建都会创建不同的工作区,例如 workspace@2,我无法在管道 groovy 中对其进行硬编码。我是否有可能获得工作区工作B?

Use "Shared workspace plugin".使用“共享工作区插件”。 This would solve this use case.这将解决这个用例。

More details: https://wiki.jenkins.io/plugins/servlet/mobile?contentId=68747370#content/view/68747370更多详情: https : //wiki.jenkins.io/plugins/servlet/mobile?contentId=68747370#content/view/68747370

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM