[英]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.