如何触发 Hudson 的另一项工作作为预构建步骤?
如何触发 Hudson 的另一项工作作为预构建步骤?
How do I trigger another job from hudson as a pre-build step?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何触发 Hudson 的另一项工作作为预构建步骤?
How do I trigger another job from hudson as a pre-build step?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
有一个参数化触发器插件,它可以启用“在其他项目上触发/调用构建”在“添加构建步骤”菜单中。
There is a Parameterized Trigger Plugin, which enables "Trigger/call builds on other projects" in "Add build step" menu.
您可以在 http://wiki.jenkins-ci.org/display 使用该插件/JENKINS/Join+Plugin
基本上,您创建了 3 个作业:
A = 您的预构建 ste
B = 您的主要作业
C = 您的触发器。
您“构建”C。它调用 A,一旦 A 成功,它就会调用 B。插件页面为您提供更多信息。这个插件的好处是你可以有任意数量的预构建作业。
在我们的 main 运行之前,我们实际上有一组 5 个预构建作业。
====================================================
如果您不想尝试:
如果您使用的是 Linux,您可以在“shell”脚本中执行以下操作:
这将触发该作业。这样做的坏处是它不会等待作业完成。
You can use the plugin at http://wiki.jenkins-ci.org/display/JENKINS/Join+Plugin
Basically you create 3 jobs:
A = your prebuild ste
B = your main job
C = your trigger.
You 'build' C. It calls A, and once A is successful, it calls B. The plugin page gives you more information. The good thing about this plugin is that you can have any number of pre-build jobs.
We actually have a set of 5 pre-build jobs before our main is run.
================================================
If you don't want to try that:
If you are using Linux, you can do the following from within your "shell" script:
This will trigger the job. The bad part about this is that it will not wait for the job to finish.
其实我知道如何回答你的问题:
这是您需要的插件:
PreBuild
它不是广为人知,但它可以满足您的需求。
它基本上在您选择的构建之前运行构建。例如:您希望 A 在 B 之前运行。
你点击“运行B”,它将在运行B之前执行A。
专业版:
->用途广泛
-> 使用
易于
->如果预构建失败,则不支持/选项(例如,如果预构建失败,则不构建)
->开发似乎根本不那么活跃。
在这里你可以看到它的样子
编辑
这个答案是从 12 年回来的,我知道你很沮丧 -投票,但当时这是一个可靠的解决方案,现在我确信还有其他插件可以完成这项工作。
Actually I know how to answer to your question:
This is the plug-in that you need:
PreBuild
It is not widely famous, but it does what you want.
It basically runs a Build before your chosen one. For example: You want A to run before B.
You click on "run B" it will execute A before running B.
Pro:
-> Very versatile
-> Easy to use
Cons:
-> No support / Option in case the pre-build fails (e.g. do not build if pre-build fails)
-> The development seems not being that active at all.
Here you can see how it looks like
EDIT
This answer is back from '12, I know you are down-voting it, but back then this was a reliable solution, now I am sure there are other plug-ins that do the job.
我有同样的问题,我找到了一种方法:
我正在使用 jenkins 版本 jenkins-1.452-1.1。
假设我有作业 A 和 B,作业 A 依赖于作业 B。在构建作业 B 时,我希望 A 自动触发,并且 B 被阻止,直到 A 构建成功。
在构建部分定义构建配置时,我添加“触发其他项目的构建”。然后填写表格。
I have the same issue and I found a way to do:
I am using jenkins version jenkins-1.452-1.1.
Say I have job A and B, and Job A is depending on job B. When building job B, I want A triggered automatically, and B is blocked until A build successfully.
When define build configuration in build section, I add 'trigger build on other projects'. then fill the form.