diff --git a/jobs/templates/swh-pipeline-diff.yaml b/jobs/templates/swh-pipeline-diff.yaml --- a/jobs/templates/swh-pipeline-diff.yaml +++ b/jobs/templates/swh-pipeline-diff.yaml @@ -8,10 +8,11 @@ default-tox-environment: py3 concurrent: true sandbox: true - auth-token: 'ph4br1cat0r' + auth-token: "ph4br1cat0r" phabricator_diff: true do_cypress: false timeout: 10 + max_concurrent: 0 properties: - build-discarder: days-to-keep: 90 @@ -39,6 +40,4 @@ description: tox environment to use for the main tox run default: "{default-tox-environment}" - dsl: - !include-jinja2: swh-pipeline.groovy.j2 - + dsl: !include-jinja2: swh-pipeline.groovy.j2 diff --git a/jobs/templates/swh-pipeline.groovy.j2 b/jobs/templates/swh-pipeline.groovy.j2 --- a/jobs/templates/swh-pipeline.groovy.j2 +++ b/jobs/templates/swh-pipeline.groovy.j2 @@ -3,6 +3,19 @@ {%- include 'includes/agent-docker.groovy.j2' -%} {% endfilter %} + options { + // require "Throttle Concurrent Builds" Jenkins plugin + throttleJobProperty( + categories: [], + limitOneJobWithMatchingParams: false, + maxConcurrentPerNode: {{ max_concurrent }}, + maxConcurrentTotal: {{ max_concurrent }}, + paramsToUseForLimit: '', + throttleEnabled: true, + throttleOption: 'project', + ) + } + environment { PHAB_CONDUIT_URL = 'https://forge.softwareheritage.org/api/' } diff --git a/jobs/templates/swh-pipeline.yaml b/jobs/templates/swh-pipeline.yaml --- a/jobs/templates/swh-pipeline.yaml +++ b/jobs/templates/swh-pipeline.yaml @@ -8,9 +8,9 @@ default-tox-environment: py3 concurrent: true triggers: - - timed: '@daily' + - timed: "@daily" sandbox: true - auth-token: 'ph4br1cat0r' + auth-token: "ph4br1cat0r" properties: - build-discarder: days-to-keep: 90 @@ -18,6 +18,7 @@ phabricator_diff: false do_cypress: false timeout: 10 + max_concurrent: 0 parameters: - git-parameter: name: REVISION @@ -32,6 +33,4 @@ description: tox environment to use for the main tox run default: "{default-tox-environment}" - dsl: - !include-jinja2: swh-pipeline.groovy.j2 - + dsl: !include-jinja2: swh-pipeline.groovy.j2