How can we enable concurrent builds but only if the builds are on different branches?

Hi @srirammk and welcome to this community :wave:

I think Jenkins can provide a way to configure concurrent builds while also restricting parallel builds of the same branch. This could be achieved by using the “Throttle Concurrent Builds” plugin. Here are the steps to configure this plugin:

  1. Install the “Throttle Concurrent Builds” plugin on your Jenkins instance.
  2. Go to the configuration page of the job for which you want to enable concurrent builds.
  3. Under the “Build Environment” section, check the “Throttle Concurrent Builds” checkbox.
  4. Configure the plugin as per your requirements. Here, you need to set “Throttle Matrix Project” to the desired value (typically 1) and select the “Category” option as “Branch Name”.
  5. Save the job configuration.

With this configuration, Jenkins will allow only one build of a specific branch to run at a time, while still allowing other builds of different branches to run concurrently.