summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSorin Sbarnea <ssbarnea@redhat.com>2018-04-28 10:15:02 +0100
committerSorin Sbarnea <ssbarnea@redhat.com>2018-04-28 10:15:07 +0100
commit89b531613c88735d52c4280f31110c1ae53da714 (patch)
tree2a1310e29a63c4a44c0a7fe17b28c5eefee7f931
parent53523f9727eff9b8d1f292f790a6e9e3e250f131 (diff)
fixed config format for nodejs plugin
Updates generated config for nodejs to match current configuration format. Change-Id: Ie2642cc81d7dcf176c3d826120850dfaa1811150 Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
Notes
Notes (review): Code-Review+1: Anil Belur <askb23@gmail.com> Code-Review+2: Kien Ha <kienha9922@gmail.com> Workflow+1: Sorin Sbarnea <ssbarnea@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 16 May 2018 09:24:48 +0000 Reviewed-on: https://review.openstack.org/565001 Project: openstack-infra/jenkins-job-builder Branch: refs/heads/master
-rw-r--r--jenkins_jobs/modules/wrappers.py7
-rw-r--r--tests/wrappers/fixtures/nodejs-installator001.xml4
2 files changed, 7 insertions, 4 deletions
diff --git a/jenkins_jobs/modules/wrappers.py b/jenkins_jobs/modules/wrappers.py
index 4421f98..d46b54a 100644
--- a/jenkins_jobs/modules/wrappers.py
+++ b/jenkins_jobs/modules/wrappers.py
@@ -1814,8 +1814,11 @@ def nodejs_installator(registry, xml_parent, data):
1814 /../../tests/wrappers/fixtures/nodejs-installator001.yaml 1814 /../../tests/wrappers/fixtures/nodejs-installator001.yaml
1815 """ 1815 """
1816 npm_node = XML.SubElement(xml_parent, 1816 npm_node = XML.SubElement(xml_parent,
1817 'jenkins.plugins.nodejs.tools.' 1817 'jenkins.plugins.nodejs.'
1818 'NpmPackagesBuildWrapper') 1818 'NodeJSBuildWrapper')
1819
1820 version = registry.get_plugin_info('nodejs').get('version', '0')
1821 npm_node.set("plugin", "nodejs@" + version)
1819 mapping = [('name', 'nodeJSInstallationName', None)] 1822 mapping = [('name', 'nodeJSInstallationName', None)]
1820 convert_mapping_to_xml(npm_node, data, mapping, fail_required=True) 1823 convert_mapping_to_xml(npm_node, data, mapping, fail_required=True)
1821 1824
diff --git a/tests/wrappers/fixtures/nodejs-installator001.xml b/tests/wrappers/fixtures/nodejs-installator001.xml
index a52ae52..ff95fa2 100644
--- a/tests/wrappers/fixtures/nodejs-installator001.xml
+++ b/tests/wrappers/fixtures/nodejs-installator001.xml
@@ -1,8 +1,8 @@
1<?xml version="1.0" encoding="utf-8"?> 1<?xml version="1.0" encoding="utf-8"?>
2<project> 2<project>
3 <buildWrappers> 3 <buildWrappers>
4 <jenkins.plugins.nodejs.tools.NpmPackagesBuildWrapper> 4 <jenkins.plugins.nodejs.NodeJSBuildWrapper plugin="nodejs@0">
5 <nodeJSInstallationName>latest node</nodeJSInstallationName> 5 <nodeJSInstallationName>latest node</nodeJSInstallationName>
6 </jenkins.plugins.nodejs.tools.NpmPackagesBuildWrapper> 6 </jenkins.plugins.nodejs.NodeJSBuildWrapper>
7 </buildWrappers> 7 </buildWrappers>
8</project> 8</project>