diff --git a/jenkins_jobs/modules/triggers.py b/jenkins_jobs/modules/triggers.py index 4afbb2241..9b34e489f 100644 --- a/jenkins_jobs/modules/triggers.py +++ b/jenkins_jobs/modules/triggers.py @@ -1638,6 +1638,9 @@ def gitlab(registry, xml_parent, data): * **never** (default) * **source** * **both** + :arg bool trigger-only-if-new-commits-pushed: Trigger a build on commits pushed + only, but not trigger on another MR changes(label, edit, assign, etc) + (>=1.5.17)(default false) :arg bool trigger-note: Build when comment is added with defined phrase (>= 1.2.4) (default true) :arg str note-regex: Phrase that triggers the build (>= 1.2.4) (default @@ -1755,6 +1758,7 @@ def gitlab(registry, xml_parent, data): mapping = [ ("trigger-push", "triggerOnPush", True), ("trigger-merge-request", "triggerOnMergeRequest", True), + ("trigger-only-if-new-commits-pushed", "triggerOnlyIfNewCommitsPushed", False), ("trigger-accepted-merge-request", "triggerOnAcceptedMergeRequest", False), ("trigger-closed-merge-request", "triggerOnClosedMergeRequest", False), ("trigger-note", "triggerOnNoteRequest", True), diff --git a/tests/triggers/fixtures/gitlab001.xml b/tests/triggers/fixtures/gitlab001.xml index 2f87069f1..7a3b6d489 100644 --- a/tests/triggers/fixtures/gitlab001.xml +++ b/tests/triggers/fixtures/gitlab001.xml @@ -7,6 +7,7 @@ true true + false false false true diff --git a/tests/triggers/fixtures/gitlab002.xml b/tests/triggers/fixtures/gitlab002.xml index f92b5091c..add8cf68c 100644 --- a/tests/triggers/fixtures/gitlab002.xml +++ b/tests/triggers/fixtures/gitlab002.xml @@ -7,6 +7,7 @@ true true + false false false true diff --git a/tests/triggers/fixtures/gitlab003.xml b/tests/triggers/fixtures/gitlab003.xml index 907731e8a..52d2b24b9 100644 --- a/tests/triggers/fixtures/gitlab003.xml +++ b/tests/triggers/fixtures/gitlab003.xml @@ -7,6 +7,7 @@ true true + false false false true diff --git a/tests/triggers/fixtures/gitlab004.xml b/tests/triggers/fixtures/gitlab004.xml index c70b069b3..c12c01b88 100644 --- a/tests/triggers/fixtures/gitlab004.xml +++ b/tests/triggers/fixtures/gitlab004.xml @@ -7,6 +7,7 @@ false false + false false false true diff --git a/tests/triggers/fixtures/gitlab004.yaml b/tests/triggers/fixtures/gitlab004.yaml index fbd2f5725..f3e742d30 100644 --- a/tests/triggers/fixtures/gitlab004.yaml +++ b/tests/triggers/fixtures/gitlab004.yaml @@ -2,6 +2,7 @@ triggers: - gitlab: trigger-push: false trigger-merge-request: false + trigger-only-if-new-commits-pushed: false trigger-open-merge-request-push: both ci-skip: false set-build-description: false diff --git a/tests/triggers/fixtures/gitlab005.xml b/tests/triggers/fixtures/gitlab005.xml index 6bda664d8..74901697e 100644 --- a/tests/triggers/fixtures/gitlab005.xml +++ b/tests/triggers/fixtures/gitlab005.xml @@ -7,6 +7,7 @@ true true + false false false true diff --git a/tests/triggers/fixtures/gitlab006.xml b/tests/triggers/fixtures/gitlab006.xml index 36b84fe6e..0d3e860fe 100644 --- a/tests/triggers/fixtures/gitlab006.xml +++ b/tests/triggers/fixtures/gitlab006.xml @@ -7,6 +7,7 @@ false false + false false false true diff --git a/tests/triggers/fixtures/gitlab007.xml b/tests/triggers/fixtures/gitlab007.xml index c51382e8f..25eab8ba5 100644 --- a/tests/triggers/fixtures/gitlab007.xml +++ b/tests/triggers/fixtures/gitlab007.xml @@ -7,6 +7,7 @@ true true + true true true true diff --git a/tests/triggers/fixtures/gitlab007.yaml b/tests/triggers/fixtures/gitlab007.yaml index 31bc2698e..a2d54f07b 100644 --- a/tests/triggers/fixtures/gitlab007.yaml +++ b/tests/triggers/fixtures/gitlab007.yaml @@ -2,6 +2,7 @@ triggers: - gitlab: trigger-push: true trigger-merge-request: true + trigger-only-if-new-commits-pushed: true trigger-accepted-merge-request: true trigger-closed-merge-request: true ci-skip: true diff --git a/tests/triggers/fixtures/gitlab008.xml b/tests/triggers/fixtures/gitlab008.xml index 2e4962d09..4fc9fdaf4 100644 --- a/tests/triggers/fixtures/gitlab008.xml +++ b/tests/triggers/fixtures/gitlab008.xml @@ -7,6 +7,7 @@ false false + false false false true