how to configure job in jekins if first project is build successful then trigger another project and so on with “Multi-configuration project” job

孤街浪徒 提交于 2019-12-11 12:42:06

问题


I want to trigger project in jekins if first project is build successful then trigger another project and so on.. how can do it. I hava project1 , project2, and project3, project4, project5 so on. here I am configuring "Multi-configuration project" job.

for exp:- project1->success then trigger project2->success then trigger project3

if any stage failed then doesn't trigger other project.This is "Multi-configuration project" job, because this single job, I am trigger on multiple slaves remotely.


回答1:


A simple way to do this would be to define this build pipeline using the Pipeline plugin.

This pipeline script should give you the desired behaviour:

build job: 'project1'
build job: 'project2'
build job: 'project3'
build job: 'project4'
build job: 'project5'

i.e. A build of each job will be started in sequence; if any one of them fails, then the subsequent jobs will not be started.




回答2:


Even with "Multi-configuration project" you should be able to set a post-build action "Trigger parameterized build on other projects". Then you can specify condition which will define when this project should be build, and add parameters, including "build on the same node".



来源:https://stackoverflow.com/questions/35410466/how-to-configure-job-in-jekins-if-first-project-is-build-successful-then-trigger

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!