问题
I am a novice when it comes to Jenkins. I would like to be able to take different projects and build them in sequence with each other with a Pipeline. I have noticed that Jenkins can run various stages in sequence or in parallel via a Pipeline. Is there a way for this to happen with running projects in sequence or in parallel that exists on the same node?
回答1:
Yes, you can use build step to trigger any project (job) you want in Jenkins. See https://jenkins.io/doc/pipeline/steps/pipeline-build-step/
回答2:
I know this question is a bit old. But in case there's someone out there that might be searching for an answer, follow these steps (Remember the names of the Jobs as you need to type them)
- Create a "Multijob Project"
- In the "Build" section, type the Name of your first Job.
- Again In the "Build" section, "Add build step" type the next Job name.
In both builds, "Block until the triggered projects finish" should be ticked.
Save & Build your Multijob Project.
来源:https://stackoverflow.com/questions/52998433/jenkins-pipeline-to-build-multiple-projects-in-sequence