From bc55a673a075de6983b37a9150e05cfca99b5ab3 Mon Sep 17 00:00:00 2001 From: Mykola Nikishov Date: Fri, 4 Jan 2019 20:13:37 +0200 Subject: [PATCH] Do not ignore global-settings-type in Maven module settings-type parameter hides global-settings-type and makes it impossible to use settings from the file and ConfigFileProvider at the same time like: maven: settings-type: file settings: mvn/settings.xml global-settings-type: cfp global-settings: test Change-Id: Ieda05912ae8b28942d98150a51c92b2521f2b6bf Signed-off-by: Mykola Nikishov --- jenkins_jobs/modules/helpers.py | 2 +- .../project-maven-global-settings-type.xml | 33 +++++++++++++++++++ .../project-maven-global-settings-type.yaml | 7 ++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 tests/general/fixtures/project-maven-global-settings-type.xml create mode 100644 tests/general/fixtures/project-maven-global-settings-type.yaml diff --git a/jenkins_jobs/modules/helpers.py b/jenkins_jobs/modules/helpers.py index 286712015..d4bea4ca4 100644 --- a/jenkins_jobs/modules/helpers.py +++ b/jenkins_jobs/modules/helpers.py @@ -155,7 +155,7 @@ def config_file_provider_settings(xml_parent, data): if 'global-settings' in data: # Support for Config File Provider global_settings_file = str(data['global-settings']) - global_settings_type = data.get('settings-type', 'file') + global_settings_type = data.get('global-settings-type', 'file') # For cfp versions <2.10.0 we are able to detect cfp via the config # settings name. diff --git a/tests/general/fixtures/project-maven-global-settings-type.xml b/tests/general/fixtures/project-maven-global-settings-type.xml new file mode 100644 index 000000000..fb3fa50a9 --- /dev/null +++ b/tests/general/fixtures/project-maven-global-settings-type.xml @@ -0,0 +1,33 @@ + + + deploy + true + pom.xml + true + false + false + false + false + false + false + -1 + false + false + + test + + + test + + + FAILURE + 2 + RED + + + false + false + false + false + true + diff --git a/tests/general/fixtures/project-maven-global-settings-type.yaml b/tests/general/fixtures/project-maven-global-settings-type.yaml new file mode 100644 index 000000000..fc636ea7f --- /dev/null +++ b/tests/general/fixtures/project-maven-global-settings-type.yaml @@ -0,0 +1,7 @@ +project-type: maven +maven: + goals: deploy + settings-type: file + settings: test + global-settings-type: cfp + global-settings: test