My question is fairly straightforward: With a Freestyle Jenkins project under "Advance Project Options" I can select two configuration options that help prevent conflicts between different projects (that may arise e.g. when one project updates a set of header files while another project is including these):
- Block build when upstream project is building
- Block build when downstream project is building
For a Pipeline or Multibranch project these configuration options are unavailable, and I am (so far without success) looking for a way to achieve the same effect for a Pipeline or Multibranch project.
You may solve this with the Lockable Resource Plugin.
By creating a shared resource used by upstream, and downstream, projects. Let the pipeline wait for it to be available.
来源:https://stackoverflow.com/questions/38845882/how-can-i-block-a-jenkins-2-x-pipeline-job-while-dependent-jobs-are-building