引用另一个 Hudson 作业中的文件
我有两个工作,A 和 B,我希望工作 B 使用 A 的最后一个稳定版本中的文件。
似乎 Hudson UI 能够显示所有信息,所以我希望在作业 B 中可以通过某种方式访问该信息。
可能有一个解决方案可以将文件、构建后复制到共享位置并从那里使用它,但我不想担心作业 A 开始构建并尝试在作业 B 拥有该文件时破坏该文件在使用中。
啊,但我想我确实需要将作业 A 的文件复制到某个地方,并且可能将其放在以内部版本号命名的目录中。好的,新问题是如何从作业 B 获取作业 A 的最后一个稳定版本#?
注:
- Windows环境
What I have is two jobs, A and B, and I'd like job B to use a file from A's last stable build.
Seems like the Hudson UI is able to display all of the information, so I am hoping that there is some way, in Job B, to access that information.
There is probably a solution to copy the file, post build, to a shared location and use it from there, but I don't want to have to worry about Job A starting to build and attempting to whack the file while Job B has it in use.
Ah, but I guess I really do need to copy Job A's file somewhere, and probably put it in a directory named with the build number. Okay, so the new question is how to I get Job A's last stable build # from Job B?
Notes:
- Windows environment
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用“归档工件”功能在作业 A 中归档所需的文件。然后在作业 B 中,通过永久链接将文件下拉到上次成功构建的位置。
类似于:
但将“A”替换为您的作业名称,并将“myartifact.txt”替换为您的工件的路径
Use the 'archive the artifacts' feature to archive the file you want in job A. Then in job B, pull down the file via the permalink to the last successful build.
Something like:
but replace 'A' with your job name, and 'myartifact.txt' with the path to your artifact
我想提一下参数化触发器插件:
http://wiki。 hudson-ci.org/display/HUDSON/Parameterized+Trigger+Plugin
理想情况下,我认为最好的解决方案是让此插件使用构建 A 中的文件触发构建 B。但是,正如当前状态所示, “未来•支持文件参数(用于在构建之间传递文件)”
在添加该支持之前,我所做的是将工件从作业 A 复制到共享,然后使用参数化触发器插件来触发作业 B 并为其提供共享上文件的名称(唯一的名称,因此不会发生冲突)。我将文件名放在“属性文件”中(请参阅插件文档),以便触发作业 B。然后作业 B 可以获取该文件并运行。
I would like to mention the Parameterized Trigger Plugin:
http://wiki.hudson-ci.org/display/HUDSON/Parameterized+Trigger+Plugin
Ideally, I believe the best solution would be to have this plugin trigger build B with the file from build A. However, as the current status says, "Future •Support file parameters (for passing files from build to build)"
Until that support is added, what I do is copy the artifact from job A to a share, then use the Parameterized Trigger Plugin to trigger job B and give it the name (a unique name so there are no conflicts) of the file on the share. I put the file name in a "properties file" (see plugin documentation) in order to trigger job B. Job B can then grab the file and run.