简体   繁体   English

Jenkins只在完成一项工作后触发工作并避免并行执行工作

[英]Jenkins trigger a job only after one has completed and avoid parallel execution of jobs

I have two jobs in Jenkins: Job A that gets triggered on a commit and job B. Technically job B is triggered only after job A has been completed as job B is mentioned as a downstream of job A in the post build actions, but imagine this scenario: 我在Jenkins中有两个工作:在提交和工作B上触发的工作A.技术上工作B仅在工作A完成后触发,因为工作B在后期构建操作中被提及为工作A的下游,但是想象一下这种情况:

Job A has been triggered by one commit and is running while the job B is still running from previous commit of job A, this is causing potential failures and complexity as both are running in parallel. 作业A已由一次提交触发,并且在作业B仍在从先前的作业A提交运行时正在运行,这导致潜在的故障和复杂性,因为两者并行运行。

What is the best way to prevent both of them running in parallel? 防止它们并行运行的最佳方法是什么?

These are the plugins I saw on jenkins wiki: 这些是我在jenkins wiki上看到的插件:

Build Blocker Plugin Build Blocker插件
Multijob Plugin Multijob插件

Still wanted to know the best course of action. 仍然想知道最好的行动方案。

You can use the Multijob plugin for this and then both sub jobs will be wrapped in one job that is triggered by a commit. 您可以使用Multijob插件,然后将两个子作业包装在一个由提交触发的作业中。

You can avoid parallel execution of that job (in case of 2 commits in short time, the 1st commit will trigger the job, the 2nd will be 'pending') 您可以避免并行执行该作业(如果在短时间内提交2次,则第一次提交将触发作业,第二次提交将“挂起”)

暂无
暂无

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

相关问题 詹金斯 - 在所有下游工作完成后触发工作,而不仅仅是直接工作 - Jenkins - trigger job after all downstream jobs have completed, not only the immediate ones 如何并行触发大量 Jenkins 作业,避免那些接收相同作业 ID 的作业? - How to trigger numerous Jenkins jobs in parallel avoiding those receiving same job ID? 如何在Jenkins中并行运行3个作业,然后在所有3个作业成功完成后立即和if和立即触发第四个作业 - How to run 3 jobs in Jenkins in parallel then trigger fourth job if and IMMEDIATELY when all 3 complete successfully 詹金斯(Jenkins):工作完成后触发未来的建造 - Jenkins: Trigger a future build once a job is completed 在另一个工作完成之后,我如何在周末执行詹金斯工作? - How do I run a Jenkins job on a weekend, AFTER another job has completed? 完成当前正在运行的作业后,如何在 Jenkins UI 中禁用节点? - How do I disable a node in Jenkins UI after it has completed its currently running jobs? 如何在成功完成另一个作业后触发jenkins作业,并且这两个作业都在不同的Jenkins服务器上运行 - How Can I trigger a jenkins job after successful completion of another job and both the jobs are running in different Jenkins server 如何仅成功执行两个上游作业来触发jenkins下游作业 - how to trigger jenkins downstream job only both upstreams jobs successfully executed 在詹金斯(Jenkins)上,成功完成两个任务中的任何一个但不能同时完成两个任务后,如何触发构建? - On Jenkins, how do I trigger builds after job succeeds for either 2 jobs but not for both? 1个jenkins作业根据参数触发多个jenkins作业 - 1 jenkins job trigger multiple jenkins jobs based on parameters
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM