diff options
author | Mykola Nikishov <mn@mn.com.ua> | 2019-01-04 20:13:37 +0200 |
---|---|---|
committer | Mykola Nikishov <mn@mn.com.ua> | 2019-01-04 23:58:20 +0200 |
commit | bc55a673a075de6983b37a9150e05cfca99b5ab3 (patch) | |
tree | 75cafa3ffc0162e14f04adc46008b63deea48eed | |
parent | b1499530dbb5ad66f52fbfc4ffa1343da79df441 (diff) | |
download | python-jenkins-job-builder-bc55a673a075de6983b37a9150e05cfca99b5ab3.tar.gz python-jenkins-job-builder-bc55a673a075de6983b37a9150e05cfca99b5ab3.tar.xz python-jenkins-job-builder-bc55a673a075de6983b37a9150e05cfca99b5ab3.zip |
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 <mn@mn.com.ua>
-rw-r--r-- | jenkins_jobs/modules/helpers.py | 2 | ||||
-rw-r--r-- | tests/general/fixtures/project-maven-global-settings-type.xml | 33 | ||||
-rw-r--r-- | tests/general/fixtures/project-maven-global-settings-type.yaml | 7 |
3 files changed, 41 insertions, 1 deletions
diff --git a/jenkins_jobs/modules/helpers.py b/jenkins_jobs/modules/helpers.py index 28671201..d4bea4ca 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 00000000..fb3fa50a --- /dev/null +++ b/tests/general/fixtures/project-maven-global-settings-type.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<maven2-moduleset> + <goals>deploy</goals> + <ignoreUpstremChanges>true</ignoreUpstremChanges> + <rootPOM>pom.xml</rootPOM> + <aggregatorStyleBuild>true</aggregatorStyleBuild> + <incrementalBuild>false</incrementalBuild> + <siteArchivingDisabled>false</siteArchivingDisabled> + <fingerprintingDisabled>false</fingerprintingDisabled> + <archivingDisabled>false</archivingDisabled> + <resolveDependencies>false</resolveDependencies> + <processPlugins>false</processPlugins> + <mavenValidationLevel>-1</mavenValidationLevel> + <runHeadless>false</runHeadless> + <disableTriggerDownstreamProjects>false</disableTriggerDownstreamProjects> + <settings class="jenkins.mvn.FilePathSettingsProvider"> + <path>test</path> + </settings> + <globalSettings class="org.jenkinsci.plugins.configfiles.maven.job.MvnGlobalSettingsProvider"> + <settingsConfigId>test</settingsConfigId> + </globalSettings> + <runPostStepsIfResult> + <name>FAILURE</name> + <ordinal>2</ordinal> + <color>RED</color> + </runPostStepsIfResult> + <actions/> + <keepDependencies>false</keepDependencies> + <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> + <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> + <concurrentBuild>false</concurrentBuild> + <canRoam>true</canRoam> +</maven2-moduleset> 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 00000000..fc636ea7 --- /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 |