0

Let's say I have 5 maven jobs which compile some code when push to a Git repo happens. Now I have a pipeline job that deploys all those compiled code somewhere. This deploy job is triggered after any of the 5 compiling jobs are build.

My problem is, when those 5 jobs are triggered on the same time. The deploy job is then scheduled 5 times. Is there a way to say:

  • Trigger this job after any of those 5 jobs are built
  • If they are build on the same time, wait for the last before build
  • Schedule only once
Jan Krakora
  • 2,500
  • 3
  • 25
  • 52

1 Answers1

0

You could trigger a 6th pipeline job at the end of your 5 pipelines This last job would be configured with property disableConcurrentBuilds

exemple of usage for declarative pipeline:

pipeline {
    options {
        disableConcurrentBuilds()

In an ideal world your pipelines should push your binaries to a binary repository like Sonatype Nexus or jfrog artifactory One of the 5 jobs would fetch the artifacts from the bin repo and deploy them using lock/milestone steps or the property disableConcurrentBuilds

fredericrous
  • 2,833
  • 1
  • 25
  • 26