From: Thanh Ha Date: Thu, 3 May 2018 15:48:04 +0000 (-0400) Subject: Add override for GT file-paths in Python jobs X-Git-Tag: v0.19.0~2^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=aa256b7a0769f6c9c9906cacb4d87f49e691622c;p=releng%2Fglobal-jjb.git Add override for GT file-paths in Python jobs Some projects may have small Python sub-projects within their repos. This would allow them to only trigger builds when there is a change in the relevant directory. Change-Id: If54f43eb3f66d0c6b493495a82a65989fc7ed6c3 Signed-off-by: Thanh Ha Signed-off-by: Daniel Farrell --- diff --git a/docs/jjb/lf-python-jobs.rst b/docs/jjb/lf-python-jobs.rst index 980e8678..6288c4da 100644 --- a/docs/jjb/lf-python-jobs.rst +++ b/docs/jjb/lf-python-jobs.rst @@ -75,6 +75,11 @@ IQ Server. :submodule-recursive: Whether to checkout submodules recursively. (default: true) :gerrit_clm_triggers: Override Gerrit Triggers. + :gerrit_trigger_file_paths: Override file paths which used to filter which + file modifications will trigger a build. Refer to JJB documentation for + "file-path" details. + https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit + Python Sonar with Tox --------------------- @@ -137,6 +142,11 @@ https://docs.sonarqube.org/display/PLUG/Python+Coverage+Results+Import :submodule-recursive: Whether to checkout submodules recursively. (default: true) :gerrit_sonar_triggers: Override Gerrit Triggers. + :gerrit_trigger_file_paths: Override file paths which used to filter which + file modifications will trigger a build. Refer to JJB documentation for + "file-path" details. + https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit + Tox Verify ---------- @@ -180,3 +190,7 @@ following pyenv variables before running. (default: '') :tox-envs: Tox environments to run. If blank run everything described in tox.ini. (default: '') + :gerrit_trigger_file_paths: Override file paths which used to filter which + file modifications will trigger a build. Refer to JJB documentation for + "file-path" details. + https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit diff --git a/jjb/lf-python-jobs.yaml b/jjb/lf-python-jobs.yaml index be66e059..0029f3ec 100644 --- a/jjb/lf-python-jobs.yaml +++ b/jjb/lf-python-jobs.yaml @@ -102,6 +102,9 @@ gerrit_clm_triggers: - comment-added-contains-event: comment-contains-value: run-clm$ + gerrit_trigger_file_paths: + - compare-type: ANT + pattern: '**' ##################### # Job Configuration # @@ -125,6 +128,7 @@ branches: - branch-compare-type: ANT branch-pattern: '**/{branch}' + file-paths: '{obj:gerrit_trigger_file_paths}' skip-vote: successful: true failed: true @@ -219,6 +223,9 @@ gerrit_sonar_triggers: - comment-added-contains-event: comment-contains-value: run-sonar$ + gerrit_trigger_file_paths: + - compare-type: ANT + pattern: '**' ##################### # Job Configuration # @@ -260,6 +267,7 @@ branches: - branch-compare-type: 'ANT' branch-pattern: '**/master' + file-paths: '{obj:gerrit_trigger_file_paths}' skip-vote: successful: true failed: true @@ -430,6 +438,9 @@ - draft-published-event - comment-added-contains-event: comment-contains-value: recheck$ + gerrit_trigger_file_paths: + - compare-type: ANT + pattern: '**' parallel: true @@ -463,6 +474,7 @@ branches: - branch-compare-type: ANT branch-pattern: '**/{branch}' + file-paths: '{obj:gerrit_trigger_file_paths}' - job-template: # Python projects typically use tox to run testing.