Disentangle YamlParser and ModuleRegistry classes
Create the ModuleRegistry anywhere other than inside the YamlParser class. This will make it slightly easier to factor a XmlGenerator out of YamlParser, but I also want to work toward eliminating the circular references between YamlParser and ModuleRegistry which have been making it difficult to understand overall program flow. This commit also replaces all YamlParser instances being passed to Jenkins job config generating functions with a ModuleRegistry. Mostly it seems like the parser was only needed to call the ModuleRegistry's 'dispatch' method which to be honest I don't fully understand. This is where the circular references mentioned in previously come in...it seems like the "dispatch" function needs access to the (mostly) raw data contained by the parser, so it took that as a parameter. The need for the YamlParser's job data can be satisfied by assigning it to a property on the ModuleRegistry object before Yaml expansion or XML generation begins; by doing this, we allow the ModuleRegistry to avoid referencing the parser. Change-Id: I4b571299b81e708540392ad963163fe092acf1d9
This commit is contained in:
parent
8c9c50b1f6
commit
ae1fb60f16
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
from jenkins_jobs.builder import Builder
|
from jenkins_jobs.builder import Builder
|
||||||
from jenkins_jobs.parser import YamlParser
|
from jenkins_jobs.parser import YamlParser
|
||||||
|
from jenkins_jobs.registry import ModuleRegistry
|
||||||
import jenkins_jobs.cli.subcommand.base as base
|
import jenkins_jobs.cli.subcommand.base as base
|
||||||
|
|
||||||
|
|
||||||
@ -39,16 +40,15 @@ class DeleteSubCommand(base.BaseSubCommand):
|
|||||||
def execute(self, options, jjb_config):
|
def execute(self, options, jjb_config):
|
||||||
builder = Builder(jjb_config)
|
builder = Builder(jjb_config)
|
||||||
|
|
||||||
parser = YamlParser(jjb_config, builder.plugins_list)
|
|
||||||
|
|
||||||
fn = options.path
|
fn = options.path
|
||||||
|
|
||||||
|
registry = ModuleRegistry(jjb_config, builder.plugins_list)
|
||||||
for jobs_glob in options.name:
|
for jobs_glob in options.name:
|
||||||
parser = YamlParser(jjb_config, builder.plugins_list)
|
parser = YamlParser(jjb_config)
|
||||||
|
|
||||||
if fn:
|
if fn:
|
||||||
parser.load_files(fn)
|
parser.load_files(fn)
|
||||||
parser.expandYaml([jobs_glob])
|
parser.expandYaml(registry, [jobs_glob])
|
||||||
jobs = [j['name'] for j in parser.jobs]
|
jobs = [j['name'] for j in parser.jobs]
|
||||||
else:
|
else:
|
||||||
jobs = [jobs_glob]
|
jobs = [jobs_glob]
|
||||||
|
@ -19,6 +19,7 @@ import time
|
|||||||
|
|
||||||
from jenkins_jobs.builder import Builder
|
from jenkins_jobs.builder import Builder
|
||||||
from jenkins_jobs.parser import YamlParser
|
from jenkins_jobs.parser import YamlParser
|
||||||
|
from jenkins_jobs.registry import ModuleRegistry
|
||||||
from jenkins_jobs.errors import JenkinsJobsException
|
from jenkins_jobs.errors import JenkinsJobsException
|
||||||
import jenkins_jobs.cli.subcommand.base as base
|
import jenkins_jobs.cli.subcommand.base as base
|
||||||
|
|
||||||
@ -71,10 +72,14 @@ class UpdateSubCommand(base.BaseSubCommand):
|
|||||||
orig = time.time()
|
orig = time.time()
|
||||||
|
|
||||||
# Generate XML
|
# Generate XML
|
||||||
parser = YamlParser(jjb_config, builder.plugins_list)
|
parser = YamlParser(jjb_config)
|
||||||
|
registry = ModuleRegistry(jjb_config, builder.plugins_list)
|
||||||
|
|
||||||
parser.load_files(options.path)
|
parser.load_files(options.path)
|
||||||
parser.expandYaml(options.names)
|
registry.set_parser_data(parser.data)
|
||||||
parser.generateXML()
|
|
||||||
|
parser.expandYaml(registry, options.names)
|
||||||
|
parser.generateXML(registry)
|
||||||
|
|
||||||
jobs = parser.jobs
|
jobs = parser.jobs
|
||||||
step = time.time()
|
step = time.time()
|
||||||
|
@ -72,7 +72,7 @@ class Base(object):
|
|||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def gen_xml(self, parser, xml_parent, data):
|
def gen_xml(self, xml_parent, data):
|
||||||
"""Update the XML element tree based on YAML data. Override
|
"""Update the XML element tree based on YAML data. Override
|
||||||
this method to add elements to the XML output. Create new
|
this method to add elements to the XML output. Create new
|
||||||
Element objects and add them to the xml_parent. The YAML data
|
Element objects and add them to the xml_parent. The YAML data
|
||||||
|
@ -58,7 +58,7 @@ from jenkins_jobs.modules.publishers import ssh
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def shell(parser, xml_parent, data):
|
def shell(registry, xml_parent, data):
|
||||||
"""yaml: shell
|
"""yaml: shell
|
||||||
Execute a shell command.
|
Execute a shell command.
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ def shell(parser, xml_parent, data):
|
|||||||
XML.SubElement(shell, 'command').text = data
|
XML.SubElement(shell, 'command').text = data
|
||||||
|
|
||||||
|
|
||||||
def python(parser, xml_parent, data):
|
def python(registry, xml_parent, data):
|
||||||
"""yaml: python
|
"""yaml: python
|
||||||
Execute a python command. Requires the Jenkins :jenkins-wiki:`Python plugin
|
Execute a python command. Requires the Jenkins :jenkins-wiki:`Python plugin
|
||||||
<Python+Plugin>`.
|
<Python+Plugin>`.
|
||||||
@ -91,7 +91,7 @@ def python(parser, xml_parent, data):
|
|||||||
XML.SubElement(python, 'command').text = data
|
XML.SubElement(python, 'command').text = data
|
||||||
|
|
||||||
|
|
||||||
def copyartifact(parser, xml_parent, data):
|
def copyartifact(registry, xml_parent, data):
|
||||||
"""yaml: copyartifact
|
"""yaml: copyartifact
|
||||||
|
|
||||||
Copy artifact from another project. Requires the :jenkins-wiki:`Copy
|
Copy artifact from another project. Requires the :jenkins-wiki:`Copy
|
||||||
@ -179,7 +179,7 @@ def copyartifact(parser, xml_parent, data):
|
|||||||
copyartifact_build_selector(t, data)
|
copyartifact_build_selector(t, data)
|
||||||
|
|
||||||
|
|
||||||
def change_assembly_version(parser, xml_parent, data):
|
def change_assembly_version(registry, xml_parent, data):
|
||||||
"""yaml: change-assembly-version
|
"""yaml: change-assembly-version
|
||||||
Change the assembly version.
|
Change the assembly version.
|
||||||
Requires the Jenkins :jenkins-wiki:`Change Assembly Version
|
Requires the Jenkins :jenkins-wiki:`Change Assembly Version
|
||||||
@ -203,7 +203,7 @@ def change_assembly_version(parser, xml_parent, data):
|
|||||||
data.get('assembly-file', 'AssemblyInfo.cs'))
|
data.get('assembly-file', 'AssemblyInfo.cs'))
|
||||||
|
|
||||||
|
|
||||||
def fingerprint(parser, xml_parent, data):
|
def fingerprint(registry, xml_parent, data):
|
||||||
"""yaml: fingerprint
|
"""yaml: fingerprint
|
||||||
Adds the ability to generate fingerprints as build steps instead of waiting
|
Adds the ability to generate fingerprints as build steps instead of waiting
|
||||||
for a build to complete. Requires the Jenkins :jenkins-wiki:`Fingerprint
|
for a build to complete. Requires the Jenkins :jenkins-wiki:`Fingerprint
|
||||||
@ -232,7 +232,7 @@ def fingerprint(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(fingerprint, data, mapping, fail_required=True)
|
convert_mapping_to_xml(fingerprint, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def ant(parser, xml_parent, data):
|
def ant(registry, xml_parent, data):
|
||||||
"""yaml: ant
|
"""yaml: ant
|
||||||
Execute an ant target. Requires the Jenkins :jenkins-wiki:`Ant Plugin
|
Execute an ant target. Requires the Jenkins :jenkins-wiki:`Ant Plugin
|
||||||
<Ant+Plugin>`.
|
<Ant+Plugin>`.
|
||||||
@ -299,7 +299,7 @@ def ant(parser, xml_parent, data):
|
|||||||
XML.SubElement(ant, 'antName').text = data.get('ant-name', 'default')
|
XML.SubElement(ant, 'antName').text = data.get('ant-name', 'default')
|
||||||
|
|
||||||
|
|
||||||
def trigger_remote(parser, xml_parent, data):
|
def trigger_remote(registry, xml_parent, data):
|
||||||
"""yaml: trigger-remote
|
"""yaml: trigger-remote
|
||||||
Trigger build of job on remote Jenkins instance.
|
Trigger build of job on remote Jenkins instance.
|
||||||
|
|
||||||
@ -391,7 +391,7 @@ def trigger_remote(parser, xml_parent, data):
|
|||||||
XML.SubElement(triggerr, 'overrideAuth').text = "false"
|
XML.SubElement(triggerr, 'overrideAuth').text = "false"
|
||||||
|
|
||||||
|
|
||||||
def trigger_builds(parser, xml_parent, data):
|
def trigger_builds(registry, xml_parent, data):
|
||||||
"""yaml: trigger-builds
|
"""yaml: trigger-builds
|
||||||
Trigger builds of other jobs.
|
Trigger builds of other jobs.
|
||||||
Requires the Jenkins :jenkins-wiki:`Parameterized Trigger Plugin
|
Requires the Jenkins :jenkins-wiki:`Parameterized Trigger Plugin
|
||||||
@ -730,7 +730,7 @@ def trigger_builds(parser, xml_parent, data):
|
|||||||
xml_parent.remove(tbuilder)
|
xml_parent.remove(tbuilder)
|
||||||
|
|
||||||
|
|
||||||
def builders_from(parser, xml_parent, data):
|
def builders_from(registry, xml_parent, data):
|
||||||
"""yaml: builders-from
|
"""yaml: builders-from
|
||||||
Use builders from another project.
|
Use builders from another project.
|
||||||
Requires the Jenkins :jenkins-wiki:`Template Project Plugin
|
Requires the Jenkins :jenkins-wiki:`Template Project Plugin
|
||||||
@ -748,7 +748,7 @@ def builders_from(parser, xml_parent, data):
|
|||||||
XML.SubElement(pbs, 'projectName').text = data
|
XML.SubElement(pbs, 'projectName').text = data
|
||||||
|
|
||||||
|
|
||||||
def http_request(parser, xml_parent, data):
|
def http_request(registry, xml_parent, data):
|
||||||
"""yaml: http-request
|
"""yaml: http-request
|
||||||
This plugin sends a http request to an url with some parameters.
|
This plugin sends a http request to an url with some parameters.
|
||||||
Requires the Jenkins :jenkins-wiki:`HTTP Request Plugin
|
Requires the Jenkins :jenkins-wiki:`HTTP Request Plugin
|
||||||
@ -851,7 +851,7 @@ def http_request(parser, xml_parent, data):
|
|||||||
fail_required=True)
|
fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def inject(parser, xml_parent, data):
|
def inject(registry, xml_parent, data):
|
||||||
"""yaml: inject
|
"""yaml: inject
|
||||||
Inject an environment for the job.
|
Inject an environment for the job.
|
||||||
Requires the Jenkins :jenkins-wiki:`EnvInject Plugin
|
Requires the Jenkins :jenkins-wiki:`EnvInject Plugin
|
||||||
@ -879,7 +879,7 @@ def inject(parser, xml_parent, data):
|
|||||||
info, 'scriptContent', data.get('script-content'))
|
info, 'scriptContent', data.get('script-content'))
|
||||||
|
|
||||||
|
|
||||||
def kmap(parser, xml_parent, data):
|
def kmap(registry, xml_parent, data):
|
||||||
"""yaml: kmap
|
"""yaml: kmap
|
||||||
Publish mobile applications to your Keivox KMAP Private Mobile App Store.
|
Publish mobile applications to your Keivox KMAP Private Mobile App Store.
|
||||||
Requires the Jenkins :jenkins-wiki:`Keivox KMAP Private Mobile App Store
|
Requires the Jenkins :jenkins-wiki:`Keivox KMAP Private Mobile App Store
|
||||||
@ -952,7 +952,7 @@ def kmap(parser, xml_parent, data):
|
|||||||
publish_optional, data, publish_mapping, fail_required=True)
|
publish_optional, data, publish_mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def artifact_resolver(parser, xml_parent, data):
|
def artifact_resolver(registry, xml_parent, data):
|
||||||
"""yaml: artifact-resolver
|
"""yaml: artifact-resolver
|
||||||
Allows one to resolve artifacts from a maven repository like nexus
|
Allows one to resolve artifacts from a maven repository like nexus
|
||||||
(without having maven installed)
|
(without having maven installed)
|
||||||
@ -1008,7 +1008,7 @@ def artifact_resolver(parser, xml_parent, data):
|
|||||||
XML.SubElement(ar, 'releaseChecksumPolicy').text = 'warn'
|
XML.SubElement(ar, 'releaseChecksumPolicy').text = 'warn'
|
||||||
|
|
||||||
|
|
||||||
def doxygen(parser, xml_parent, data):
|
def doxygen(registry, xml_parent, data):
|
||||||
"""yaml: doxygen
|
"""yaml: doxygen
|
||||||
Builds doxygen HTML documentation. Requires the Jenkins
|
Builds doxygen HTML documentation. Requires the Jenkins
|
||||||
:jenkins-wiki:`Doxygen plugin <Doxygen+Plugin>`.
|
:jenkins-wiki:`Doxygen plugin <Doxygen+Plugin>`.
|
||||||
@ -1037,7 +1037,7 @@ def doxygen(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(doxygen, data, mappings, fail_required=True)
|
convert_mapping_to_xml(doxygen, data, mappings, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def gradle(parser, xml_parent, data):
|
def gradle(registry, xml_parent, data):
|
||||||
"""yaml: gradle
|
"""yaml: gradle
|
||||||
Execute gradle tasks. Requires the Jenkins :jenkins-wiki:`Gradle Plugin
|
Execute gradle tasks. Requires the Jenkins :jenkins-wiki:`Gradle Plugin
|
||||||
<Gradle+Plugin>`.
|
<Gradle+Plugin>`.
|
||||||
@ -1100,7 +1100,7 @@ def _groovy_common_scriptSource(data):
|
|||||||
return scriptSource
|
return scriptSource
|
||||||
|
|
||||||
|
|
||||||
def groovy(parser, xml_parent, data):
|
def groovy(registry, xml_parent, data):
|
||||||
"""yaml: groovy
|
"""yaml: groovy
|
||||||
Execute a groovy script or command.
|
Execute a groovy script or command.
|
||||||
Requires the Jenkins :jenkins-wiki:`Groovy Plugin <Groovy+plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Groovy Plugin <Groovy+plugin>`.
|
||||||
@ -1144,7 +1144,7 @@ def groovy(parser, xml_parent, data):
|
|||||||
XML.SubElement(groovy, 'classPath').text = str(data.get('class-path', ""))
|
XML.SubElement(groovy, 'classPath').text = str(data.get('class-path', ""))
|
||||||
|
|
||||||
|
|
||||||
def system_groovy(parser, xml_parent, data):
|
def system_groovy(registry, xml_parent, data):
|
||||||
"""yaml: system-groovy
|
"""yaml: system-groovy
|
||||||
Execute a system groovy script or command.
|
Execute a system groovy script or command.
|
||||||
Requires the Jenkins :jenkins-wiki:`Groovy Plugin <Groovy+plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Groovy Plugin <Groovy+plugin>`.
|
||||||
@ -1175,7 +1175,7 @@ def system_groovy(parser, xml_parent, data):
|
|||||||
data.get('class-path', ""))
|
data.get('class-path', ""))
|
||||||
|
|
||||||
|
|
||||||
def batch(parser, xml_parent, data):
|
def batch(registry, xml_parent, data):
|
||||||
"""yaml: batch
|
"""yaml: batch
|
||||||
Execute a batch command.
|
Execute a batch command.
|
||||||
|
|
||||||
@ -1190,7 +1190,7 @@ def batch(parser, xml_parent, data):
|
|||||||
XML.SubElement(batch, 'command').text = data
|
XML.SubElement(batch, 'command').text = data
|
||||||
|
|
||||||
|
|
||||||
def powershell(parser, xml_parent, data):
|
def powershell(registry, xml_parent, data):
|
||||||
"""yaml: powershell
|
"""yaml: powershell
|
||||||
Execute a powershell command. Requires the :jenkins-wiki:`Powershell Plugin
|
Execute a powershell command. Requires the :jenkins-wiki:`Powershell Plugin
|
||||||
<PowerShell+Plugin>`.
|
<PowerShell+Plugin>`.
|
||||||
@ -1206,7 +1206,7 @@ def powershell(parser, xml_parent, data):
|
|||||||
XML.SubElement(ps, 'command').text = data
|
XML.SubElement(ps, 'command').text = data
|
||||||
|
|
||||||
|
|
||||||
def msbuild(parser, xml_parent, data):
|
def msbuild(registry, xml_parent, data):
|
||||||
"""yaml: msbuild
|
"""yaml: msbuild
|
||||||
Build .NET project using msbuild. Requires the :jenkins-wiki:`Jenkins
|
Build .NET project using msbuild. Requires the :jenkins-wiki:`Jenkins
|
||||||
MSBuild Plugin <MSBuild+Plugin>`.
|
MSBuild Plugin <MSBuild+Plugin>`.
|
||||||
@ -1247,13 +1247,13 @@ def msbuild(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(msbuilder, data, mapping, fail_required=True)
|
convert_mapping_to_xml(msbuilder, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def create_builders(parser, step):
|
def create_builders(registry, step):
|
||||||
dummy_parent = XML.Element("dummy")
|
dummy_parent = XML.Element("dummy")
|
||||||
parser.registry.dispatch('builder', parser, dummy_parent, step)
|
registry.dispatch('builder', dummy_parent, step)
|
||||||
return list(dummy_parent)
|
return list(dummy_parent)
|
||||||
|
|
||||||
|
|
||||||
def conditional_step(parser, xml_parent, data):
|
def conditional_step(registry, xml_parent, data):
|
||||||
"""yaml: conditional-step
|
"""yaml: conditional-step
|
||||||
Conditionally execute some build steps. Requires the Jenkins
|
Conditionally execute some build steps. Requires the Jenkins
|
||||||
:jenkins-wiki:`Conditional BuildStep Plugin
|
:jenkins-wiki:`Conditional BuildStep Plugin
|
||||||
@ -1658,7 +1658,7 @@ def conditional_step(parser, xml_parent, data):
|
|||||||
build_condition(condition, conditions_container_tag)
|
build_condition(condition, conditions_container_tag)
|
||||||
|
|
||||||
def build_step(parent, step):
|
def build_step(parent, step):
|
||||||
for edited_node in create_builders(parser, step):
|
for edited_node in create_builders(registry, step):
|
||||||
if not has_multiple_steps:
|
if not has_multiple_steps:
|
||||||
edited_node.set('class', edited_node.tag)
|
edited_node.set('class', edited_node.tag)
|
||||||
edited_node.tag = 'buildStep'
|
edited_node.tag = 'buildStep'
|
||||||
@ -1698,7 +1698,7 @@ def conditional_step(parser, xml_parent, data):
|
|||||||
build_step(steps_parent, step)
|
build_step(steps_parent, step)
|
||||||
|
|
||||||
|
|
||||||
def maven_builder(parser, xml_parent, data):
|
def maven_builder(registry, xml_parent, data):
|
||||||
"""yaml: maven-builder
|
"""yaml: maven-builder
|
||||||
Execute Maven3 builder
|
Execute Maven3 builder
|
||||||
|
|
||||||
@ -1728,7 +1728,7 @@ def maven_builder(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(maven, data, mapping, fail_required=True)
|
convert_mapping_to_xml(maven, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def maven_target(parser, xml_parent, data):
|
def maven_target(registry, xml_parent, data):
|
||||||
"""yaml: maven-target
|
"""yaml: maven-target
|
||||||
Execute top-level Maven targets.
|
Execute top-level Maven targets.
|
||||||
|
|
||||||
@ -1781,7 +1781,7 @@ def maven_target(parser, xml_parent, data):
|
|||||||
config_file_provider_settings(maven, data)
|
config_file_provider_settings(maven, data)
|
||||||
|
|
||||||
|
|
||||||
def multijob(parser, xml_parent, data):
|
def multijob(registry, xml_parent, data):
|
||||||
"""yaml: multijob
|
"""yaml: multijob
|
||||||
Define a multijob phase. Requires the Jenkins
|
Define a multijob phase. Requires the Jenkins
|
||||||
:jenkins-wiki:`Multijob Plugin <Multijob+Plugin>`.
|
:jenkins-wiki:`Multijob Plugin <Multijob+Plugin>`.
|
||||||
@ -1961,7 +1961,7 @@ def multijob(parser, xml_parent, data):
|
|||||||
).text = kill_status
|
).text = kill_status
|
||||||
|
|
||||||
|
|
||||||
def config_file_provider(parser, xml_parent, data):
|
def config_file_provider(registry, xml_parent, data):
|
||||||
"""yaml: config-file-provider
|
"""yaml: config-file-provider
|
||||||
Provide configuration files (i.e., settings.xml for maven etc.)
|
Provide configuration files (i.e., settings.xml for maven etc.)
|
||||||
which will be copied to the job's workspace.
|
which will be copied to the job's workspace.
|
||||||
@ -1992,7 +1992,7 @@ def config_file_provider(parser, xml_parent, data):
|
|||||||
config_file_provider_builder(cfp, data)
|
config_file_provider_builder(cfp, data)
|
||||||
|
|
||||||
|
|
||||||
def grails(parser, xml_parent, data):
|
def grails(registry, xml_parent, data):
|
||||||
"""yaml: grails
|
"""yaml: grails
|
||||||
Execute a grails build step. Requires the :jenkins-wiki:`Jenkins Grails
|
Execute a grails build step. Requires the :jenkins-wiki:`Jenkins Grails
|
||||||
Plugin <Grails+Plugin>`.
|
Plugin <Grails+Plugin>`.
|
||||||
@ -2058,7 +2058,7 @@ def grails(parser, xml_parent, data):
|
|||||||
data.get('refresh-dependencies', False)).lower()
|
data.get('refresh-dependencies', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def sbt(parser, xml_parent, data):
|
def sbt(registry, xml_parent, data):
|
||||||
"""yaml: sbt
|
"""yaml: sbt
|
||||||
Execute a sbt build step. Requires the Jenkins :jenkins-wiki:`Sbt Plugin
|
Execute a sbt build step. Requires the Jenkins :jenkins-wiki:`Sbt Plugin
|
||||||
<sbt+plugin>`.
|
<sbt+plugin>`.
|
||||||
@ -2092,7 +2092,7 @@ def sbt(parser, xml_parent, data):
|
|||||||
'subdir-path', '')
|
'subdir-path', '')
|
||||||
|
|
||||||
|
|
||||||
def critical_block_start(parser, xml_parent, data):
|
def critical_block_start(registry, xml_parent, data):
|
||||||
"""yaml: critical-block-start
|
"""yaml: critical-block-start
|
||||||
Designate the start of a critical block. Must be used in conjuction with
|
Designate the start of a critical block. Must be used in conjuction with
|
||||||
critical-block-end.
|
critical-block-end.
|
||||||
@ -2113,7 +2113,7 @@ def critical_block_start(parser, xml_parent, data):
|
|||||||
cbs.set('plugin', 'Exclusion')
|
cbs.set('plugin', 'Exclusion')
|
||||||
|
|
||||||
|
|
||||||
def critical_block_end(parser, xml_parent, data):
|
def critical_block_end(registry, xml_parent, data):
|
||||||
"""yaml: critical-block-end
|
"""yaml: critical-block-end
|
||||||
Designate the end of a critical block. Must be used in conjuction with
|
Designate the end of a critical block. Must be used in conjuction with
|
||||||
critical-block-start.
|
critical-block-start.
|
||||||
@ -2134,7 +2134,7 @@ def critical_block_end(parser, xml_parent, data):
|
|||||||
cbs.set('plugin', 'Exclusion')
|
cbs.set('plugin', 'Exclusion')
|
||||||
|
|
||||||
|
|
||||||
def publish_over_ssh(parser, xml_parent, data):
|
def publish_over_ssh(registry, xml_parent, data):
|
||||||
"""yaml: publish-over-ssh
|
"""yaml: publish-over-ssh
|
||||||
Send files or execute commands over SSH.
|
Send files or execute commands over SSH.
|
||||||
Requires the Jenkins :jenkins-wiki:`Publish over SSH Plugin
|
Requires the Jenkins :jenkins-wiki:`Publish over SSH Plugin
|
||||||
@ -2160,7 +2160,7 @@ def publish_over_ssh(parser, xml_parent, data):
|
|||||||
.. literalinclude:: /../../tests/builders/fixtures/publish-over-ssh.yaml
|
.. literalinclude:: /../../tests/builders/fixtures/publish-over-ssh.yaml
|
||||||
:language: yaml
|
:language: yaml
|
||||||
"""
|
"""
|
||||||
ssh(parser, xml_parent, data)
|
ssh(registry, xml_parent, data)
|
||||||
|
|
||||||
|
|
||||||
class Builders(jenkins_jobs.modules.base.Base):
|
class Builders(jenkins_jobs.modules.base.Base):
|
||||||
@ -2169,14 +2169,13 @@ class Builders(jenkins_jobs.modules.base.Base):
|
|||||||
component_type = 'builder'
|
component_type = 'builder'
|
||||||
component_list_type = 'builders'
|
component_list_type = 'builders'
|
||||||
|
|
||||||
def gen_xml(self, parser, xml_parent, data):
|
def gen_xml(self, xml_parent, data):
|
||||||
|
|
||||||
for alias in ['prebuilders', 'builders', 'postbuilders']:
|
for alias in ['prebuilders', 'builders', 'postbuilders']:
|
||||||
if alias in data:
|
if alias in data:
|
||||||
builders = XML.SubElement(xml_parent, alias)
|
builders = XML.SubElement(xml_parent, alias)
|
||||||
for builder in data[alias]:
|
for builder in data[alias]:
|
||||||
self.registry.dispatch('builder', parser, builders,
|
self.registry.dispatch('builder', builders, builder)
|
||||||
builder)
|
|
||||||
|
|
||||||
# Make sure freestyle projects always have a <builders> entry
|
# Make sure freestyle projects always have a <builders> entry
|
||||||
# or Jenkins v1.472 (at least) will NPE.
|
# or Jenkins v1.472 (at least) will NPE.
|
||||||
@ -2185,7 +2184,7 @@ class Builders(jenkins_jobs.modules.base.Base):
|
|||||||
XML.SubElement(xml_parent, 'builders')
|
XML.SubElement(xml_parent, 'builders')
|
||||||
|
|
||||||
|
|
||||||
def shining_panda(parser, xml_parent, data):
|
def shining_panda(registry, xml_parent, data):
|
||||||
"""yaml: shining-panda
|
"""yaml: shining-panda
|
||||||
Execute a command inside various python environments. Requires the Jenkins
|
Execute a command inside various python environments. Requires the Jenkins
|
||||||
:jenkins-wiki:`ShiningPanda plugin <ShiningPanda+Plugin>`.
|
:jenkins-wiki:`ShiningPanda plugin <ShiningPanda+Plugin>`.
|
||||||
@ -2302,7 +2301,7 @@ def shining_panda(parser, xml_parent, data):
|
|||||||
XML.SubElement(t, 'ignoreExitCode').text = str(ignore_exit_code).lower()
|
XML.SubElement(t, 'ignoreExitCode').text = str(ignore_exit_code).lower()
|
||||||
|
|
||||||
|
|
||||||
def tox(parser, xml_parent, data):
|
def tox(registry, xml_parent, data):
|
||||||
"""yaml: tox
|
"""yaml: tox
|
||||||
Use tox to build a multi-configuration project. Requires the Jenkins
|
Use tox to build a multi-configuration project. Requires the Jenkins
|
||||||
:jenkins-wiki:`ShiningPanda plugin <ShiningPanda+Plugin>`.
|
:jenkins-wiki:`ShiningPanda plugin <ShiningPanda+Plugin>`.
|
||||||
@ -2328,7 +2327,7 @@ def tox(parser, xml_parent, data):
|
|||||||
XML.SubElement(t, 'toxenvPattern').text = pattern
|
XML.SubElement(t, 'toxenvPattern').text = pattern
|
||||||
|
|
||||||
|
|
||||||
def managed_script(parser, xml_parent, data):
|
def managed_script(registry, xml_parent, data):
|
||||||
"""yaml: managed-script
|
"""yaml: managed-script
|
||||||
This step allows to reference and execute a centrally managed
|
This step allows to reference and execute a centrally managed
|
||||||
script within your build. Requires the Jenkins
|
script within your build. Requires the Jenkins
|
||||||
@ -2372,7 +2371,7 @@ def managed_script(parser, xml_parent, data):
|
|||||||
XML.SubElement(args, 'string').text = arg
|
XML.SubElement(args, 'string').text = arg
|
||||||
|
|
||||||
|
|
||||||
def cmake(parser, xml_parent, data):
|
def cmake(registry, xml_parent, data):
|
||||||
"""yaml: cmake
|
"""yaml: cmake
|
||||||
Execute a CMake target. Requires the Jenkins :jenkins-wiki:`CMake Plugin
|
Execute a CMake target. Requires the Jenkins :jenkins-wiki:`CMake Plugin
|
||||||
<CMake+Plugin>`.
|
<CMake+Plugin>`.
|
||||||
@ -2497,7 +2496,7 @@ def cmake(parser, xml_parent, data):
|
|||||||
XML.SubElement(cmake, 'cleanBuild').text = str(
|
XML.SubElement(cmake, 'cleanBuild').text = str(
|
||||||
data.get('clean-build-dir', False)).lower()
|
data.get('clean-build-dir', False)).lower()
|
||||||
|
|
||||||
plugin_info = parser.registry.get_plugin_info("CMake plugin")
|
plugin_info = registry.get_plugin_info("CMake plugin")
|
||||||
version = pkg_resources.parse_version(plugin_info.get("version", "1.0"))
|
version = pkg_resources.parse_version(plugin_info.get("version", "1.0"))
|
||||||
|
|
||||||
# Version 2.x breaks compatibility. So parse the input data differently
|
# Version 2.x breaks compatibility. So parse the input data differently
|
||||||
@ -2580,7 +2579,7 @@ def cmake(parser, xml_parent, data):
|
|||||||
XML.SubElement(cmake, 'builderImpl')
|
XML.SubElement(cmake, 'builderImpl')
|
||||||
|
|
||||||
|
|
||||||
def dsl(parser, xml_parent, data):
|
def dsl(registry, xml_parent, data):
|
||||||
"""yaml: dsl
|
"""yaml: dsl
|
||||||
Process Job DSL
|
Process Job DSL
|
||||||
|
|
||||||
@ -2670,7 +2669,7 @@ def dsl(parser, xml_parent, data):
|
|||||||
'additional-classpath')
|
'additional-classpath')
|
||||||
|
|
||||||
|
|
||||||
def github_notifier(parser, xml_parent, data):
|
def github_notifier(registry, xml_parent, data):
|
||||||
"""yaml: github-notifier
|
"""yaml: github-notifier
|
||||||
Set pending build status on Github commit.
|
Set pending build status on Github commit.
|
||||||
Requires the Jenkins :jenkins-wiki:`Github Plugin <GitHub+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Github Plugin <GitHub+Plugin>`.
|
||||||
@ -2684,7 +2683,7 @@ def github_notifier(parser, xml_parent, data):
|
|||||||
'com.cloudbees.jenkins.GitHubSetCommitStatusBuilder')
|
'com.cloudbees.jenkins.GitHubSetCommitStatusBuilder')
|
||||||
|
|
||||||
|
|
||||||
def scan_build(parser, xml_parent, data):
|
def scan_build(registry, xml_parent, data):
|
||||||
"""yaml: scan-build
|
"""yaml: scan-build
|
||||||
This plugin allows you configure a build step that will execute the Clang
|
This plugin allows you configure a build step that will execute the Clang
|
||||||
scan-build static analysis tool against an XCode project.
|
scan-build static analysis tool against an XCode project.
|
||||||
@ -2747,7 +2746,7 @@ def scan_build(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(p, data, mappings, fail_required=True)
|
convert_mapping_to_xml(p, data, mappings, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def ssh_builder(parser, xml_parent, data):
|
def ssh_builder(registry, xml_parent, data):
|
||||||
"""yaml: ssh-builder
|
"""yaml: ssh-builder
|
||||||
Executes command on remote host
|
Executes command on remote host
|
||||||
Requires the Jenkins :jenkins-wiki:`SSH plugin <SSH+plugin>`.
|
Requires the Jenkins :jenkins-wiki:`SSH plugin <SSH+plugin>`.
|
||||||
@ -2770,7 +2769,7 @@ def ssh_builder(parser, xml_parent, data):
|
|||||||
raise MissingAttributeError("'%s'" % e.args[0])
|
raise MissingAttributeError("'%s'" % e.args[0])
|
||||||
|
|
||||||
|
|
||||||
def sonar(parser, xml_parent, data):
|
def sonar(registry, xml_parent, data):
|
||||||
"""yaml: sonar
|
"""yaml: sonar
|
||||||
Invoke standalone Sonar analysis.
|
Invoke standalone Sonar analysis.
|
||||||
Requires the Jenkins `Sonar Plugin.
|
Requires the Jenkins `Sonar Plugin.
|
||||||
@ -2809,7 +2808,7 @@ def sonar(parser, xml_parent, data):
|
|||||||
XML.SubElement(sonar, 'jdk').text = data['jdk']
|
XML.SubElement(sonar, 'jdk').text = data['jdk']
|
||||||
|
|
||||||
|
|
||||||
def xcode(parser, xml_parent, data):
|
def xcode(registry, xml_parent, data):
|
||||||
"""yaml: xcode
|
"""yaml: xcode
|
||||||
This step allows to execute an xcode build step. Requires the Jenkins
|
This step allows to execute an xcode build step. Requires the Jenkins
|
||||||
:jenkins-wiki:`Xcode Plugin <Xcode+Plugin>`.
|
:jenkins-wiki:`Xcode Plugin <Xcode+Plugin>`.
|
||||||
@ -2939,7 +2938,7 @@ def xcode(parser, xml_parent, data):
|
|||||||
data.get('keychain-unlock', False)).lower()
|
data.get('keychain-unlock', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def sonatype_clm(parser, xml_parent, data):
|
def sonatype_clm(registry, xml_parent, data):
|
||||||
"""yaml: sonatype-clm
|
"""yaml: sonatype-clm
|
||||||
Requires the Jenkins :jenkins-wiki:`Sonatype CLM Plugin
|
Requires the Jenkins :jenkins-wiki:`Sonatype CLM Plugin
|
||||||
<Sonatype+CLM+%28formerly+Insight+for+CI%29>`.
|
<Sonatype+CLM+%28formerly+Insight+for+CI%29>`.
|
||||||
@ -3007,7 +3006,7 @@ def sonatype_clm(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(clm, data, mappings, fail_required=True)
|
convert_mapping_to_xml(clm, data, mappings, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def beaker(parser, xml_parent, data):
|
def beaker(registry, xml_parent, data):
|
||||||
"""yaml: beaker
|
"""yaml: beaker
|
||||||
Execute a beaker build step. Requires the Jenkins :jenkins-wiki:`Beaker
|
Execute a beaker build step. Requires the Jenkins :jenkins-wiki:`Beaker
|
||||||
Builder Plugin <Beaker+Builder+Plugin>`.
|
Builder Plugin <Beaker+Builder+Plugin>`.
|
||||||
@ -3046,7 +3045,7 @@ def beaker(parser, xml_parent, data):
|
|||||||
'download-logs', False)).lower()
|
'download-logs', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def cloudformation(parser, xml_parent, data):
|
def cloudformation(registry, xml_parent, data):
|
||||||
"""yaml: cloudformation
|
"""yaml: cloudformation
|
||||||
Create cloudformation stacks before running a build and optionally
|
Create cloudformation stacks before running a build and optionally
|
||||||
delete them at the end. Requires the Jenkins :jenkins-wiki:`AWS
|
delete them at the end. Requires the Jenkins :jenkins-wiki:`AWS
|
||||||
@ -3089,7 +3088,7 @@ def cloudformation(parser, xml_parent, data):
|
|||||||
region_dict)
|
region_dict)
|
||||||
|
|
||||||
|
|
||||||
def openshift_build_verify(parser, xml_parent, data):
|
def openshift_build_verify(registry, xml_parent, data):
|
||||||
"""yaml: openshift-build-verify
|
"""yaml: openshift-build-verify
|
||||||
Performs the equivalent of an 'oc get builds` command invocation for the
|
Performs the equivalent of an 'oc get builds` command invocation for the
|
||||||
provided buildConfig key provided; once the list of builds are obtained,
|
provided buildConfig key provided; once the list of builds are obtained,
|
||||||
@ -3138,7 +3137,7 @@ def openshift_build_verify(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def openshift_builder(parser, xml_parent, data):
|
def openshift_builder(registry, xml_parent, data):
|
||||||
"""yaml: openshift-builder
|
"""yaml: openshift-builder
|
||||||
Perform builds in OpenShift for the job.
|
Perform builds in OpenShift for the job.
|
||||||
Requires the Jenkins :jenkins-wiki:`OpenShift
|
Requires the Jenkins :jenkins-wiki:`OpenShift
|
||||||
@ -3194,7 +3193,7 @@ def openshift_builder(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def openshift_creator(parser, xml_parent, data):
|
def openshift_creator(registry, xml_parent, data):
|
||||||
"""yaml: openshift-creator
|
"""yaml: openshift-creator
|
||||||
Performs the equivalent of an oc create command invocation;
|
Performs the equivalent of an oc create command invocation;
|
||||||
this build step takes in the provided JSON or YAML text, and if it
|
this build step takes in the provided JSON or YAML text, and if it
|
||||||
@ -3242,7 +3241,7 @@ def openshift_creator(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def openshift_dep_verify(parser, xml_parent, data):
|
def openshift_dep_verify(registry, xml_parent, data):
|
||||||
"""yaml: openshift-dep-verify
|
"""yaml: openshift-dep-verify
|
||||||
Determines whether the expected set of DeploymentConfig's,
|
Determines whether the expected set of DeploymentConfig's,
|
||||||
ReplicationController's, and active replicas are present based on prior
|
ReplicationController's, and active replicas are present based on prior
|
||||||
@ -3293,7 +3292,7 @@ def openshift_dep_verify(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def openshift_deployer(parser, xml_parent, data):
|
def openshift_deployer(registry, xml_parent, data):
|
||||||
"""yaml: openshift-deployer
|
"""yaml: openshift-deployer
|
||||||
Start a deployment in OpenShift for the job.
|
Start a deployment in OpenShift for the job.
|
||||||
Requires the Jenkins :jenkins-wiki:`OpenShift
|
Requires the Jenkins :jenkins-wiki:`OpenShift
|
||||||
@ -3339,7 +3338,7 @@ def openshift_deployer(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def openshift_img_tagger(parser, xml_parent, data):
|
def openshift_img_tagger(registry, xml_parent, data):
|
||||||
"""yaml: openshift-img-tagger
|
"""yaml: openshift-img-tagger
|
||||||
Performs the equivalent of an oc tag command invocation in order to
|
Performs the equivalent of an oc tag command invocation in order to
|
||||||
manipulate tags for images in OpenShift ImageStream's
|
manipulate tags for images in OpenShift ImageStream's
|
||||||
@ -3390,7 +3389,7 @@ def openshift_img_tagger(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def openshift_scaler(parser, xml_parent, data):
|
def openshift_scaler(registry, xml_parent, data):
|
||||||
"""yaml: openshift-scaler
|
"""yaml: openshift-scaler
|
||||||
Scale deployments in OpenShift for the job.
|
Scale deployments in OpenShift for the job.
|
||||||
Requires the Jenkins :jenkins-wiki:`OpenShift
|
Requires the Jenkins :jenkins-wiki:`OpenShift
|
||||||
@ -3437,7 +3436,7 @@ def openshift_scaler(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def openshift_svc_verify(parser, xml_parent, data):
|
def openshift_svc_verify(registry, xml_parent, data):
|
||||||
"""yaml: openshift-svc-verify
|
"""yaml: openshift-svc-verify
|
||||||
Verify a service is up in OpenShift for the job.
|
Verify a service is up in OpenShift for the job.
|
||||||
Requires the Jenkins :jenkins-wiki:`OpenShift
|
Requires the Jenkins :jenkins-wiki:`OpenShift
|
||||||
@ -3482,7 +3481,7 @@ def openshift_svc_verify(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def runscope(parser, xml_parent, data):
|
def runscope(registry, xml_parent, data):
|
||||||
"""yaml: runscope
|
"""yaml: runscope
|
||||||
Execute a Runscope test.
|
Execute a Runscope test.
|
||||||
Requires the Jenkins :jenkins-wiki:`Runscope Plugin <Runscope+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Runscope Plugin <Runscope+Plugin>`.
|
||||||
@ -3513,7 +3512,7 @@ def runscope(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(runscope, data, mapping, fail_required=True)
|
convert_mapping_to_xml(runscope, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def description_setter(parser, xml_parent, data):
|
def description_setter(registry, xml_parent, data):
|
||||||
"""yaml: description-setter
|
"""yaml: description-setter
|
||||||
This plugin sets the description for each build,
|
This plugin sets the description for each build,
|
||||||
based upon a RegEx test of the build log file.
|
based upon a RegEx test of the build log file.
|
||||||
@ -3579,7 +3578,7 @@ def docker_build_publish(parse, xml_parent, data):
|
|||||||
convert_mapping_to_xml(db, data, mapping, fail_required=True)
|
convert_mapping_to_xml(db, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def build_name_setter(parser, xml_parent, data):
|
def build_name_setter(registry, xml_parent, data):
|
||||||
"""yaml: build-name-setter
|
"""yaml: build-name-setter
|
||||||
Define Build Name Setter options which allows your build name to be
|
Define Build Name Setter options which allows your build name to be
|
||||||
updated during the build process.
|
updated during the build process.
|
||||||
|
@ -117,7 +117,7 @@ class General(jenkins_jobs.modules.base.Base):
|
|||||||
sequence = 10
|
sequence = 10
|
||||||
logrotate_warn_issued = False
|
logrotate_warn_issued = False
|
||||||
|
|
||||||
def gen_xml(self, parser, xml, data):
|
def gen_xml(self, xml, data):
|
||||||
jdk = data.get('jdk', None)
|
jdk = data.get('jdk', None)
|
||||||
if jdk:
|
if jdk:
|
||||||
XML.SubElement(xml, 'jdk').text = jdk
|
XML.SubElement(xml, 'jdk').text = jdk
|
||||||
@ -190,10 +190,10 @@ class General(jenkins_jobs.modules.base.Base):
|
|||||||
lr_anum.text = str(logrotate.get('artifactNumToKeep', -1))
|
lr_anum.text = str(logrotate.get('artifactNumToKeep', -1))
|
||||||
|
|
||||||
if 'raw' in data:
|
if 'raw' in data:
|
||||||
raw(parser, xml, data['raw'])
|
raw(self.registry, xml, data['raw'])
|
||||||
|
|
||||||
|
|
||||||
def raw(parser, xml_parent, data):
|
def raw(registry, xml_parent, data):
|
||||||
# documented in definition.rst since includes and docs is not working well
|
# documented in definition.rst since includes and docs is not working well
|
||||||
# For cross cutting method like this
|
# For cross cutting method like this
|
||||||
root = XML.fromstring(data.get('xml'))
|
root = XML.fromstring(data.get('xml'))
|
||||||
|
@ -247,9 +247,8 @@ def findbugs_settings(xml_parent, data):
|
|||||||
convert_mapping_to_xml(xml_parent, data, mapping, fail_required=True)
|
convert_mapping_to_xml(xml_parent, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def get_value_from_yaml_or_config_file(key, section, data, parser):
|
def get_value_from_yaml_or_config_file(key, section, data, jjb_config):
|
||||||
result = data.get(key, '')
|
result = data.get(key, '')
|
||||||
jjb_config = parser.jjb_config
|
|
||||||
if result == '':
|
if result == '':
|
||||||
result = jjb_config.get_module_config(section, key)
|
result = jjb_config.get_module_config(section, key)
|
||||||
return result
|
return result
|
||||||
|
@ -117,7 +117,7 @@ class HipChat(jenkins_jobs.modules.base.Base):
|
|||||||
self.jenkinsUrl = jjb_config.jenkins['url']
|
self.jenkinsUrl = jjb_config.jenkins['url']
|
||||||
self.sendAs = jjb_config.get_module_config('hipchat', 'send-as')
|
self.sendAs = jjb_config.get_module_config('hipchat', 'send-as')
|
||||||
|
|
||||||
def gen_xml(self, parser, xml_parent, data):
|
def gen_xml(self, xml_parent, data):
|
||||||
hipchat = data.get('hipchat')
|
hipchat = data.get('hipchat')
|
||||||
if not hipchat or not hipchat.get('enabled', True):
|
if not hipchat or not hipchat.get('enabled', True):
|
||||||
return
|
return
|
||||||
@ -144,8 +144,7 @@ class HipChat(jenkins_jobs.modules.base.Base):
|
|||||||
"'hipchat' module supports the old plugin versions <1.9, "
|
"'hipchat' module supports the old plugin versions <1.9, "
|
||||||
"newer versions are supported via the 'publishers' module. "
|
"newer versions are supported via the 'publishers' module. "
|
||||||
"Please upgrade you job definition")
|
"Please upgrade you job definition")
|
||||||
return self.registry.dispatch('publisher', parser, publishers,
|
return self.registry.dispatch('publisher', publishers, data)
|
||||||
data)
|
|
||||||
else:
|
else:
|
||||||
properties = xml_parent.find('properties')
|
properties = xml_parent.find('properties')
|
||||||
if properties is None:
|
if properties is None:
|
||||||
|
@ -36,7 +36,7 @@ import xml.etree.ElementTree as XML
|
|||||||
import jenkins_jobs.modules.base
|
import jenkins_jobs.modules.base
|
||||||
|
|
||||||
|
|
||||||
def base_metadata(parser, xml_parent, data, mtype):
|
def base_metadata(registry, xml_parent, data, mtype):
|
||||||
pdef = XML.SubElement(xml_parent, mtype)
|
pdef = XML.SubElement(xml_parent, mtype)
|
||||||
XML.SubElement(pdef, 'name').text = data['name']
|
XML.SubElement(pdef, 'name').text = data['name']
|
||||||
XML.SubElement(pdef, 'generated').text = 'false'
|
XML.SubElement(pdef, 'generated').text = 'false'
|
||||||
@ -48,7 +48,7 @@ def base_metadata(parser, xml_parent, data, mtype):
|
|||||||
return pdef
|
return pdef
|
||||||
|
|
||||||
|
|
||||||
def string_metadata(parser, xml_parent, data):
|
def string_metadata(registry, xml_parent, data):
|
||||||
"""yaml: string
|
"""yaml: string
|
||||||
A string metadata.
|
A string metadata.
|
||||||
|
|
||||||
@ -64,13 +64,13 @@ def string_metadata(parser, xml_parent, data):
|
|||||||
value: bar
|
value: bar
|
||||||
expose-to-env: true
|
expose-to-env: true
|
||||||
"""
|
"""
|
||||||
pdef = base_metadata(parser, xml_parent, data,
|
pdef = base_metadata(registry, xml_parent, data,
|
||||||
'metadata-string')
|
'metadata-string')
|
||||||
value = data.get('value', '')
|
value = data.get('value', '')
|
||||||
XML.SubElement(pdef, 'value').text = value
|
XML.SubElement(pdef, 'value').text = value
|
||||||
|
|
||||||
|
|
||||||
def number_metadata(parser, xml_parent, data):
|
def number_metadata(registry, xml_parent, data):
|
||||||
"""yaml: number
|
"""yaml: number
|
||||||
A number metadata.
|
A number metadata.
|
||||||
|
|
||||||
@ -86,13 +86,13 @@ def number_metadata(parser, xml_parent, data):
|
|||||||
value: 1
|
value: 1
|
||||||
expose-to-env: true
|
expose-to-env: true
|
||||||
"""
|
"""
|
||||||
pdef = base_metadata(parser, xml_parent, data,
|
pdef = base_metadata(registry, xml_parent, data,
|
||||||
'metadata-number')
|
'metadata-number')
|
||||||
value = data.get('value', '')
|
value = data.get('value', '')
|
||||||
XML.SubElement(pdef, 'value').text = value
|
XML.SubElement(pdef, 'value').text = value
|
||||||
|
|
||||||
|
|
||||||
def date_metadata(parser, xml_parent, data):
|
def date_metadata(registry, xml_parent, data):
|
||||||
"""yaml: date
|
"""yaml: date
|
||||||
A date metadata
|
A date metadata
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ def date_metadata(parser, xml_parent, data):
|
|||||||
timezone: Australia/Melbourne
|
timezone: Australia/Melbourne
|
||||||
expose-to-env: true
|
expose-to-env: true
|
||||||
"""
|
"""
|
||||||
pdef = base_metadata(parser, xml_parent, data,
|
pdef = base_metadata(registry, xml_parent, data,
|
||||||
'metadata-date')
|
'metadata-date')
|
||||||
# TODO: convert time from any reasonable format into epoch
|
# TODO: convert time from any reasonable format into epoch
|
||||||
mval = XML.SubElement(pdef, 'value')
|
mval = XML.SubElement(pdef, 'value')
|
||||||
@ -125,7 +125,7 @@ class Metadata(jenkins_jobs.modules.base.Base):
|
|||||||
component_type = 'metadata'
|
component_type = 'metadata'
|
||||||
component_list_type = 'metadata'
|
component_list_type = 'metadata'
|
||||||
|
|
||||||
def gen_xml(self, parser, xml_parent, data):
|
def gen_xml(self, xml_parent, data):
|
||||||
properties = xml_parent.find('properties')
|
properties = xml_parent.find('properties')
|
||||||
if properties is None:
|
if properties is None:
|
||||||
properties = XML.SubElement(xml_parent, 'properties')
|
properties = XML.SubElement(xml_parent, 'properties')
|
||||||
@ -136,5 +136,4 @@ class Metadata(jenkins_jobs.modules.base.Base):
|
|||||||
'job-metadata', plugin="metadata@1.0b")
|
'job-metadata', plugin="metadata@1.0b")
|
||||||
pdefs = XML.SubElement(pdefp, 'values')
|
pdefs = XML.SubElement(pdefp, 'values')
|
||||||
for mdata in metadata:
|
for mdata in metadata:
|
||||||
self.registry.dispatch('metadata',
|
self.registry.dispatch('metadata', pdefs, mdata)
|
||||||
parser, pdefs, mdata)
|
|
||||||
|
@ -30,7 +30,7 @@ from jenkins_jobs.errors import JenkinsJobsException
|
|||||||
import jenkins_jobs.modules.base
|
import jenkins_jobs.modules.base
|
||||||
|
|
||||||
|
|
||||||
def http_endpoint(parser, xml_parent, data):
|
def http_endpoint(registry, xml_parent, data):
|
||||||
"""yaml: http
|
"""yaml: http
|
||||||
Defines an HTTP notification endpoint.
|
Defines an HTTP notification endpoint.
|
||||||
Requires the Jenkins :jenkins-wiki:`Notification Plugin
|
Requires the Jenkins :jenkins-wiki:`Notification Plugin
|
||||||
@ -87,7 +87,7 @@ class Notifications(jenkins_jobs.modules.base.Base):
|
|||||||
component_type = 'notification'
|
component_type = 'notification'
|
||||||
component_list_type = 'notifications'
|
component_list_type = 'notifications'
|
||||||
|
|
||||||
def gen_xml(self, parser, xml_parent, data):
|
def gen_xml(self, xml_parent, data):
|
||||||
properties = xml_parent.find('properties')
|
properties = xml_parent.find('properties')
|
||||||
if properties is None:
|
if properties is None:
|
||||||
properties = XML.SubElement(xml_parent, 'properties')
|
properties = XML.SubElement(xml_parent, 'properties')
|
||||||
@ -102,4 +102,4 @@ class Notifications(jenkins_jobs.modules.base.Base):
|
|||||||
|
|
||||||
for endpoint in notifications:
|
for endpoint in notifications:
|
||||||
self.registry.dispatch('notification',
|
self.registry.dispatch('notification',
|
||||||
parser, endpoints_element, endpoint)
|
endpoints_element, endpoint)
|
||||||
|
@ -41,7 +41,7 @@ import jenkins_jobs.modules.base
|
|||||||
from jenkins_jobs.modules.helpers import copyartifact_build_selector
|
from jenkins_jobs.modules.helpers import copyartifact_build_selector
|
||||||
|
|
||||||
|
|
||||||
def base_param(parser, xml_parent, data, do_default, ptype):
|
def base_param(registry, xml_parent, data, do_default, ptype):
|
||||||
pdef = XML.SubElement(xml_parent, ptype)
|
pdef = XML.SubElement(xml_parent, ptype)
|
||||||
XML.SubElement(pdef, 'name').text = data['name']
|
XML.SubElement(pdef, 'name').text = data['name']
|
||||||
XML.SubElement(pdef, 'description').text = data.get('description', '')
|
XML.SubElement(pdef, 'description').text = data.get('description', '')
|
||||||
@ -54,7 +54,7 @@ def base_param(parser, xml_parent, data, do_default, ptype):
|
|||||||
return pdef
|
return pdef
|
||||||
|
|
||||||
|
|
||||||
def string_param(parser, xml_parent, data):
|
def string_param(registry, xml_parent, data):
|
||||||
"""yaml: string
|
"""yaml: string
|
||||||
A string parameter.
|
A string parameter.
|
||||||
|
|
||||||
@ -70,11 +70,11 @@ def string_param(parser, xml_parent, data):
|
|||||||
default: bar
|
default: bar
|
||||||
description: "A parameter named FOO, defaults to 'bar'."
|
description: "A parameter named FOO, defaults to 'bar'."
|
||||||
"""
|
"""
|
||||||
base_param(parser, xml_parent, data, True,
|
base_param(registry, xml_parent, data, True,
|
||||||
'hudson.model.StringParameterDefinition')
|
'hudson.model.StringParameterDefinition')
|
||||||
|
|
||||||
|
|
||||||
def promoted_param(parser, xml_parent, data):
|
def promoted_param(registry, xml_parent, data):
|
||||||
"""yaml: promoted build
|
"""yaml: promoted build
|
||||||
A promoted build parameter.
|
A promoted build parameter.
|
||||||
Requires the Jenkins :jenkins-wiki:`Promoted Builds Plugin
|
Requires the Jenkins :jenkins-wiki:`Promoted Builds Plugin
|
||||||
@ -92,7 +92,7 @@ def promoted_param(parser, xml_parent, data):
|
|||||||
:language: yaml
|
:language: yaml
|
||||||
|
|
||||||
"""
|
"""
|
||||||
pdef = base_param(parser, xml_parent, data, False,
|
pdef = base_param(registry, xml_parent, data, False,
|
||||||
'hudson.plugins.promoted__builds.parameters.'
|
'hudson.plugins.promoted__builds.parameters.'
|
||||||
'PromotedBuildParameterDefinition')
|
'PromotedBuildParameterDefinition')
|
||||||
try:
|
try:
|
||||||
@ -104,7 +104,7 @@ def promoted_param(parser, xml_parent, data):
|
|||||||
'promotion-name', None)
|
'promotion-name', None)
|
||||||
|
|
||||||
|
|
||||||
def password_param(parser, xml_parent, data):
|
def password_param(registry, xml_parent, data):
|
||||||
"""yaml: password
|
"""yaml: password
|
||||||
A password parameter.
|
A password parameter.
|
||||||
|
|
||||||
@ -120,11 +120,11 @@ def password_param(parser, xml_parent, data):
|
|||||||
default: 1HSC0Ts6E161FysGf+e1xasgsHkgleLh09JUTYnipPvw=
|
default: 1HSC0Ts6E161FysGf+e1xasgsHkgleLh09JUTYnipPvw=
|
||||||
description: "A parameter named FOO."
|
description: "A parameter named FOO."
|
||||||
"""
|
"""
|
||||||
base_param(parser, xml_parent, data, True,
|
base_param(registry, xml_parent, data, True,
|
||||||
'hudson.model.PasswordParameterDefinition')
|
'hudson.model.PasswordParameterDefinition')
|
||||||
|
|
||||||
|
|
||||||
def bool_param(parser, xml_parent, data):
|
def bool_param(registry, xml_parent, data):
|
||||||
"""yaml: bool
|
"""yaml: bool
|
||||||
A boolean parameter.
|
A boolean parameter.
|
||||||
|
|
||||||
@ -141,11 +141,11 @@ def bool_param(parser, xml_parent, data):
|
|||||||
description: "A parameter named FOO, defaults to 'false'."
|
description: "A parameter named FOO, defaults to 'false'."
|
||||||
"""
|
"""
|
||||||
data['default'] = str(data.get('default', False)).lower()
|
data['default'] = str(data.get('default', False)).lower()
|
||||||
base_param(parser, xml_parent, data, True,
|
base_param(registry, xml_parent, data, True,
|
||||||
'hudson.model.BooleanParameterDefinition')
|
'hudson.model.BooleanParameterDefinition')
|
||||||
|
|
||||||
|
|
||||||
def file_param(parser, xml_parent, data):
|
def file_param(registry, xml_parent, data):
|
||||||
"""yaml: file
|
"""yaml: file
|
||||||
A file parameter.
|
A file parameter.
|
||||||
|
|
||||||
@ -159,11 +159,11 @@ def file_param(parser, xml_parent, data):
|
|||||||
name: test.txt
|
name: test.txt
|
||||||
description: "Upload test.txt."
|
description: "Upload test.txt."
|
||||||
"""
|
"""
|
||||||
base_param(parser, xml_parent, data, False,
|
base_param(registry, xml_parent, data, False,
|
||||||
'hudson.model.FileParameterDefinition')
|
'hudson.model.FileParameterDefinition')
|
||||||
|
|
||||||
|
|
||||||
def text_param(parser, xml_parent, data):
|
def text_param(registry, xml_parent, data):
|
||||||
"""yaml: text
|
"""yaml: text
|
||||||
A text parameter.
|
A text parameter.
|
||||||
|
|
||||||
@ -179,11 +179,11 @@ def text_param(parser, xml_parent, data):
|
|||||||
default: bar
|
default: bar
|
||||||
description: "A parameter named FOO, defaults to 'bar'."
|
description: "A parameter named FOO, defaults to 'bar'."
|
||||||
"""
|
"""
|
||||||
base_param(parser, xml_parent, data, True,
|
base_param(registry, xml_parent, data, True,
|
||||||
'hudson.model.TextParameterDefinition')
|
'hudson.model.TextParameterDefinition')
|
||||||
|
|
||||||
|
|
||||||
def label_param(parser, xml_parent, data):
|
def label_param(registry, xml_parent, data):
|
||||||
"""yaml: label
|
"""yaml: label
|
||||||
A node label parameter.
|
A node label parameter.
|
||||||
|
|
||||||
@ -199,12 +199,12 @@ def label_param(parser, xml_parent, data):
|
|||||||
default: precise
|
default: precise
|
||||||
description: "The node on which to run the job"
|
description: "The node on which to run the job"
|
||||||
"""
|
"""
|
||||||
base_param(parser, xml_parent, data, True,
|
base_param(registry, xml_parent, data, True,
|
||||||
'org.jvnet.jenkins.plugins.nodelabelparameter.'
|
'org.jvnet.jenkins.plugins.nodelabelparameter.'
|
||||||
'LabelParameterDefinition')
|
'LabelParameterDefinition')
|
||||||
|
|
||||||
|
|
||||||
def node_param(parser, xml_parent, data):
|
def node_param(registry, xml_parent, data):
|
||||||
"""yaml: node
|
"""yaml: node
|
||||||
Defines a list of nodes where this job could potentially be executed on.
|
Defines a list of nodes where this job could potentially be executed on.
|
||||||
Restrict where this project can be run, If your using a node or label
|
Restrict where this project can be run, If your using a node or label
|
||||||
@ -232,7 +232,7 @@ def node_param(parser, xml_parent, data):
|
|||||||
:language: yaml
|
:language: yaml
|
||||||
|
|
||||||
"""
|
"""
|
||||||
pdef = base_param(parser, xml_parent, data, False,
|
pdef = base_param(registry, xml_parent, data, False,
|
||||||
'org.jvnet.jenkins.plugins.nodelabelparameter.'
|
'org.jvnet.jenkins.plugins.nodelabelparameter.'
|
||||||
'NodeParameterDefinition')
|
'NodeParameterDefinition')
|
||||||
default = XML.SubElement(pdef, 'defaultSlaves')
|
default = XML.SubElement(pdef, 'defaultSlaves')
|
||||||
@ -258,7 +258,7 @@ def node_param(parser, xml_parent, data):
|
|||||||
data.get('allowed-multiselect', False)).lower()
|
data.get('allowed-multiselect', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def choice_param(parser, xml_parent, data):
|
def choice_param(registry, xml_parent, data):
|
||||||
"""yaml: choice
|
"""yaml: choice
|
||||||
A single selection parameter.
|
A single selection parameter.
|
||||||
|
|
||||||
@ -276,7 +276,7 @@ def choice_param(parser, xml_parent, data):
|
|||||||
- glance
|
- glance
|
||||||
description: "On which project to run?"
|
description: "On which project to run?"
|
||||||
"""
|
"""
|
||||||
pdef = base_param(parser, xml_parent, data, False,
|
pdef = base_param(registry, xml_parent, data, False,
|
||||||
'hudson.model.ChoiceParameterDefinition')
|
'hudson.model.ChoiceParameterDefinition')
|
||||||
choices = XML.SubElement(pdef, 'choices',
|
choices = XML.SubElement(pdef, 'choices',
|
||||||
{'class': 'java.util.Arrays$ArrayList'})
|
{'class': 'java.util.Arrays$ArrayList'})
|
||||||
@ -285,7 +285,7 @@ def choice_param(parser, xml_parent, data):
|
|||||||
XML.SubElement(a, 'string').text = choice
|
XML.SubElement(a, 'string').text = choice
|
||||||
|
|
||||||
|
|
||||||
def run_param(parser, xml_parent, data):
|
def run_param(registry, xml_parent, data):
|
||||||
"""yaml: run
|
"""yaml: run
|
||||||
A run parameter.
|
A run parameter.
|
||||||
|
|
||||||
@ -299,12 +299,12 @@ def run_param(parser, xml_parent, data):
|
|||||||
:language: yaml
|
:language: yaml
|
||||||
|
|
||||||
"""
|
"""
|
||||||
pdef = base_param(parser, xml_parent, data, False,
|
pdef = base_param(registry, xml_parent, data, False,
|
||||||
'hudson.model.RunParameterDefinition')
|
'hudson.model.RunParameterDefinition')
|
||||||
XML.SubElement(pdef, 'projectName').text = data['project-name']
|
XML.SubElement(pdef, 'projectName').text = data['project-name']
|
||||||
|
|
||||||
|
|
||||||
def extended_choice_param(parser, xml_parent, data):
|
def extended_choice_param(registry, xml_parent, data):
|
||||||
"""yaml: extended-choice
|
"""yaml: extended-choice
|
||||||
Creates an extended choice parameter where values can be read from a file
|
Creates an extended choice parameter where values can be read from a file
|
||||||
Requires the Jenkins :jenkins-wiki:`Extended Choice Parameter Plugin
|
Requires the Jenkins :jenkins-wiki:`Extended Choice Parameter Plugin
|
||||||
@ -346,7 +346,7 @@ def extended_choice_param(parser, xml_parent, data):
|
|||||||
:language: yaml
|
:language: yaml
|
||||||
|
|
||||||
"""
|
"""
|
||||||
pdef = base_param(parser, xml_parent, data, False,
|
pdef = base_param(registry, xml_parent, data, False,
|
||||||
'com.cwctravel.hudson.plugins.'
|
'com.cwctravel.hudson.plugins.'
|
||||||
'extended__choice__parameter.'
|
'extended__choice__parameter.'
|
||||||
'ExtendedChoiceParameterDefinition')
|
'ExtendedChoiceParameterDefinition')
|
||||||
@ -391,7 +391,7 @@ def extended_choice_param(parser, xml_parent, data):
|
|||||||
'description-property-key', '')
|
'description-property-key', '')
|
||||||
|
|
||||||
|
|
||||||
def validating_string_param(parser, xml_parent, data):
|
def validating_string_param(registry, xml_parent, data):
|
||||||
"""yaml: validating-string
|
"""yaml: validating-string
|
||||||
A validating string parameter
|
A validating string parameter
|
||||||
Requires the Jenkins :jenkins-wiki:`Validating String Plugin
|
Requires the Jenkins :jenkins-wiki:`Validating String Plugin
|
||||||
@ -413,14 +413,14 @@ def validating_string_param(parser, xml_parent, data):
|
|||||||
regex: [A-Za-z]*
|
regex: [A-Za-z]*
|
||||||
msg: Your entered value failed validation
|
msg: Your entered value failed validation
|
||||||
"""
|
"""
|
||||||
pdef = base_param(parser, xml_parent, data, True,
|
pdef = base_param(registry, xml_parent, data, True,
|
||||||
'hudson.plugins.validating__string__parameter.'
|
'hudson.plugins.validating__string__parameter.'
|
||||||
'ValidatingStringParameterDefinition')
|
'ValidatingStringParameterDefinition')
|
||||||
XML.SubElement(pdef, 'regex').text = data['regex']
|
XML.SubElement(pdef, 'regex').text = data['regex']
|
||||||
XML.SubElement(pdef, 'failedValidationMessage').text = data['msg']
|
XML.SubElement(pdef, 'failedValidationMessage').text = data['msg']
|
||||||
|
|
||||||
|
|
||||||
def svn_tags_param(parser, xml_parent, data):
|
def svn_tags_param(registry, xml_parent, data):
|
||||||
"""yaml: svn-tags
|
"""yaml: svn-tags
|
||||||
A svn tag parameter
|
A svn tag parameter
|
||||||
Requires the Jenkins :jenkins-wiki:`Parameterized Trigger Plugin
|
Requires the Jenkins :jenkins-wiki:`Parameterized Trigger Plugin
|
||||||
@ -442,7 +442,7 @@ def svn_tags_param(parser, xml_parent, data):
|
|||||||
url: http://svn.example.com/repo
|
url: http://svn.example.com/repo
|
||||||
filter: [A-za-z0-9]*
|
filter: [A-za-z0-9]*
|
||||||
"""
|
"""
|
||||||
pdef = base_param(parser, xml_parent, data, True,
|
pdef = base_param(registry, xml_parent, data, True,
|
||||||
'hudson.scm.listtagsparameter.'
|
'hudson.scm.listtagsparameter.'
|
||||||
'ListSubversionTagsParameterDefinition')
|
'ListSubversionTagsParameterDefinition')
|
||||||
XML.SubElement(pdef, 'tagsDir').text = data['url']
|
XML.SubElement(pdef, 'tagsDir').text = data['url']
|
||||||
@ -453,7 +453,7 @@ def svn_tags_param(parser, xml_parent, data):
|
|||||||
XML.SubElement(pdef, 'uuid').text = "1-1-1-1-1"
|
XML.SubElement(pdef, 'uuid').text = "1-1-1-1-1"
|
||||||
|
|
||||||
|
|
||||||
def dynamic_choice_param(parser, xml_parent, data):
|
def dynamic_choice_param(registry, xml_parent, data):
|
||||||
"""yaml: dynamic-choice
|
"""yaml: dynamic-choice
|
||||||
Dynamic Choice Parameter
|
Dynamic Choice Parameter
|
||||||
Requires the Jenkins :jenkins-wiki:`Jenkins Dynamic Parameter Plug-in
|
Requires the Jenkins :jenkins-wiki:`Jenkins Dynamic Parameter Plug-in
|
||||||
@ -478,10 +478,11 @@ def dynamic_choice_param(parser, xml_parent, data):
|
|||||||
remote: false
|
remote: false
|
||||||
read-only: false
|
read-only: false
|
||||||
"""
|
"""
|
||||||
dynamic_param_common(parser, xml_parent, data, 'ChoiceParameterDefinition')
|
dynamic_param_common(registry, xml_parent, data,
|
||||||
|
'ChoiceParameterDefinition')
|
||||||
|
|
||||||
|
|
||||||
def dynamic_string_param(parser, xml_parent, data):
|
def dynamic_string_param(registry, xml_parent, data):
|
||||||
"""yaml: dynamic-string
|
"""yaml: dynamic-string
|
||||||
Dynamic Parameter
|
Dynamic Parameter
|
||||||
Requires the Jenkins :jenkins-wiki:`Jenkins Dynamic Parameter Plug-in
|
Requires the Jenkins :jenkins-wiki:`Jenkins Dynamic Parameter Plug-in
|
||||||
@ -506,10 +507,11 @@ def dynamic_string_param(parser, xml_parent, data):
|
|||||||
remote: false
|
remote: false
|
||||||
read-only: false
|
read-only: false
|
||||||
"""
|
"""
|
||||||
dynamic_param_common(parser, xml_parent, data, 'StringParameterDefinition')
|
dynamic_param_common(registry, xml_parent, data,
|
||||||
|
'StringParameterDefinition')
|
||||||
|
|
||||||
|
|
||||||
def dynamic_choice_scriptler_param(parser, xml_parent, data):
|
def dynamic_choice_scriptler_param(registry, xml_parent, data):
|
||||||
"""yaml: dynamic-choice-scriptler
|
"""yaml: dynamic-choice-scriptler
|
||||||
Dynamic Choice Parameter (Scriptler)
|
Dynamic Choice Parameter (Scriptler)
|
||||||
Requires the Jenkins :jenkins-wiki:`Jenkins Dynamic Parameter Plug-in
|
Requires the Jenkins :jenkins-wiki:`Jenkins Dynamic Parameter Plug-in
|
||||||
@ -542,11 +544,11 @@ def dynamic_choice_scriptler_param(parser, xml_parent, data):
|
|||||||
remote: false
|
remote: false
|
||||||
read-only: false
|
read-only: false
|
||||||
"""
|
"""
|
||||||
dynamic_scriptler_param_common(parser, xml_parent, data,
|
dynamic_scriptler_param_common(registry, xml_parent, data,
|
||||||
'ScriptlerChoiceParameterDefinition')
|
'ScriptlerChoiceParameterDefinition')
|
||||||
|
|
||||||
|
|
||||||
def dynamic_string_scriptler_param(parser, xml_parent, data):
|
def dynamic_string_scriptler_param(registry, xml_parent, data):
|
||||||
"""yaml: dynamic-string-scriptler
|
"""yaml: dynamic-string-scriptler
|
||||||
Dynamic Parameter (Scriptler)
|
Dynamic Parameter (Scriptler)
|
||||||
Requires the Jenkins :jenkins-wiki:`Jenkins Dynamic Parameter Plug-in
|
Requires the Jenkins :jenkins-wiki:`Jenkins Dynamic Parameter Plug-in
|
||||||
@ -579,12 +581,12 @@ def dynamic_string_scriptler_param(parser, xml_parent, data):
|
|||||||
remote: false
|
remote: false
|
||||||
read-only: false
|
read-only: false
|
||||||
"""
|
"""
|
||||||
dynamic_scriptler_param_common(parser, xml_parent, data,
|
dynamic_scriptler_param_common(registry, xml_parent, data,
|
||||||
'ScriptlerStringParameterDefinition')
|
'ScriptlerStringParameterDefinition')
|
||||||
|
|
||||||
|
|
||||||
def dynamic_param_common(parser, xml_parent, data, ptype):
|
def dynamic_param_common(registry, xml_parent, data, ptype):
|
||||||
pdef = base_param(parser, xml_parent, data, False,
|
pdef = base_param(registry, xml_parent, data, False,
|
||||||
'com.seitenbau.jenkins.plugins.dynamicparameter.'
|
'com.seitenbau.jenkins.plugins.dynamicparameter.'
|
||||||
+ ptype)
|
+ ptype)
|
||||||
XML.SubElement(pdef, '__remote').text = str(
|
XML.SubElement(pdef, '__remote').text = str(
|
||||||
@ -604,8 +606,8 @@ def dynamic_param_common(parser, xml_parent, data, ptype):
|
|||||||
data.get('read-only', False)).lower()
|
data.get('read-only', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def dynamic_scriptler_param_common(parser, xml_parent, data, ptype):
|
def dynamic_scriptler_param_common(registry, xml_parent, data, ptype):
|
||||||
pdef = base_param(parser, xml_parent, data, False,
|
pdef = base_param(registry, xml_parent, data, False,
|
||||||
'com.seitenbau.jenkins.plugins.dynamicparameter.'
|
'com.seitenbau.jenkins.plugins.dynamicparameter.'
|
||||||
'scriptler.' + ptype)
|
'scriptler.' + ptype)
|
||||||
XML.SubElement(pdef, '__remote').text = str(
|
XML.SubElement(pdef, '__remote').text = str(
|
||||||
@ -627,7 +629,7 @@ def dynamic_scriptler_param_common(parser, xml_parent, data, ptype):
|
|||||||
'read-only', False)).lower()
|
'read-only', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def matrix_combinations_param(parser, xml_parent, data):
|
def matrix_combinations_param(registry, xml_parent, data):
|
||||||
"""yaml: matrix-combinations
|
"""yaml: matrix-combinations
|
||||||
Matrix combinations parameter
|
Matrix combinations parameter
|
||||||
Requires the Jenkins :jenkins-wiki:`Matrix Combinations Plugin
|
Requires the Jenkins :jenkins-wiki:`Matrix Combinations Plugin
|
||||||
@ -661,7 +663,7 @@ def matrix_combinations_param(parser, xml_parent, data):
|
|||||||
return pdef
|
return pdef
|
||||||
|
|
||||||
|
|
||||||
def copyartifact_build_selector_param(parser, xml_parent, data):
|
def copyartifact_build_selector_param(registry, xml_parent, data):
|
||||||
"""yaml: copyartifact-build-selector
|
"""yaml: copyartifact-build-selector
|
||||||
|
|
||||||
Control via a build parameter, which build the copyartifact plugin should
|
Control via a build parameter, which build the copyartifact plugin should
|
||||||
@ -696,7 +698,7 @@ def copyartifact_build_selector_param(parser, xml_parent, data):
|
|||||||
copyartifact_build_selector(t, data, 'defaultSelector')
|
copyartifact_build_selector(t, data, 'defaultSelector')
|
||||||
|
|
||||||
|
|
||||||
def maven_metadata_param(parser, xml_parent, data):
|
def maven_metadata_param(registry, xml_parent, data):
|
||||||
"""yaml: maven-metadata
|
"""yaml: maven-metadata
|
||||||
This parameter allows the resolution of maven artifact versions
|
This parameter allows the resolution of maven artifact versions
|
||||||
by contacting the repository and reading the maven-metadata.xml.
|
by contacting the repository and reading the maven-metadata.xml.
|
||||||
@ -734,7 +736,7 @@ def maven_metadata_param(parser, xml_parent, data):
|
|||||||
:language: yaml
|
:language: yaml
|
||||||
|
|
||||||
"""
|
"""
|
||||||
pdef = base_param(parser, xml_parent, data, False,
|
pdef = base_param(registry, xml_parent, data, False,
|
||||||
'eu.markov.jenkins.plugin.mvnmeta.'
|
'eu.markov.jenkins.plugin.mvnmeta.'
|
||||||
'MavenMetadataParameterDefinition')
|
'MavenMetadataParameterDefinition')
|
||||||
XML.SubElement(pdef, 'repoBaseUrl').text = data.get('repository-base-url',
|
XML.SubElement(pdef, 'repoBaseUrl').text = data.get('repository-base-url',
|
||||||
@ -766,7 +768,7 @@ class Parameters(jenkins_jobs.modules.base.Base):
|
|||||||
component_type = 'parameter'
|
component_type = 'parameter'
|
||||||
component_list_type = 'parameters'
|
component_list_type = 'parameters'
|
||||||
|
|
||||||
def gen_xml(self, parser, xml_parent, data):
|
def gen_xml(self, xml_parent, data):
|
||||||
properties = xml_parent.find('properties')
|
properties = xml_parent.find('properties')
|
||||||
if properties is None:
|
if properties is None:
|
||||||
properties = XML.SubElement(xml_parent, 'properties')
|
properties = XML.SubElement(xml_parent, 'properties')
|
||||||
@ -787,5 +789,4 @@ class Parameters(jenkins_jobs.modules.base.Base):
|
|||||||
if pdefs is None:
|
if pdefs is None:
|
||||||
pdefs = XML.SubElement(pdefp, 'parameterDefinitions')
|
pdefs = XML.SubElement(pdefp, 'parameterDefinitions')
|
||||||
for param in parameters:
|
for param in parameters:
|
||||||
self.registry.dispatch('parameter',
|
self.registry.dispatch('parameter', pdefs, param)
|
||||||
parser, pdefs, param)
|
|
||||||
|
@ -42,7 +42,7 @@ import jenkins_jobs.modules.base
|
|||||||
from jenkins_jobs.modules.helpers import convert_mapping_to_xml
|
from jenkins_jobs.modules.helpers import convert_mapping_to_xml
|
||||||
|
|
||||||
|
|
||||||
def builds_chain_fingerprinter(parser, xml_parent, data):
|
def builds_chain_fingerprinter(registry, xml_parent, data):
|
||||||
"""yaml: builds-chain-fingerprinter
|
"""yaml: builds-chain-fingerprinter
|
||||||
Builds chain fingerprinter.
|
Builds chain fingerprinter.
|
||||||
Requires the Jenkins :jenkins-wiki:`Builds chain fingerprinter Plugin
|
Requires the Jenkins :jenkins-wiki:`Builds chain fingerprinter Plugin
|
||||||
@ -68,7 +68,7 @@ def builds_chain_fingerprinter(parser, xml_parent, data):
|
|||||||
data.get('per-job-chain', False)).lower()
|
data.get('per-job-chain', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def ownership(parser, xml_parent, data):
|
def ownership(registry, xml_parent, data):
|
||||||
"""yaml: ownership
|
"""yaml: ownership
|
||||||
Plugin provides explicit ownership for jobs and slave nodes.
|
Plugin provides explicit ownership for jobs and slave nodes.
|
||||||
Requires the Jenkins :jenkins-wiki:`Ownership Plugin <Ownership+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Ownership Plugin <Ownership+Plugin>`.
|
||||||
@ -96,7 +96,7 @@ def ownership(parser, xml_parent, data):
|
|||||||
XML.SubElement(coownersIds, 'string').text = coowner
|
XML.SubElement(coownersIds, 'string').text = coowner
|
||||||
|
|
||||||
|
|
||||||
def promoted_build(parser, xml_parent, data):
|
def promoted_build(registry, xml_parent, data):
|
||||||
"""yaml: promoted-build
|
"""yaml: promoted-build
|
||||||
Marks a build for promotion. A promotion process with an identical
|
Marks a build for promotion. A promotion process with an identical
|
||||||
name must be created via the web interface in the job in order for the job
|
name must be created via the web interface in the job in order for the job
|
||||||
@ -121,7 +121,7 @@ def promoted_build(parser, xml_parent, data):
|
|||||||
XML.SubElement(active_processes, 'string').text = str(n)
|
XML.SubElement(active_processes, 'string').text = str(n)
|
||||||
|
|
||||||
|
|
||||||
def github(parser, xml_parent, data):
|
def github(registry, xml_parent, data):
|
||||||
"""yaml: github
|
"""yaml: github
|
||||||
Sets the GitHub URL for the project.
|
Sets the GitHub URL for the project.
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ def github(parser, xml_parent, data):
|
|||||||
raise MissingAttributeError(e)
|
raise MissingAttributeError(e)
|
||||||
|
|
||||||
|
|
||||||
def gitlab(parser, xml_parent, data):
|
def gitlab(registry, xml_parent, data):
|
||||||
"""yaml: gitlab
|
"""yaml: gitlab
|
||||||
Sets the GitLab connection for the project. Configured via Jenkins Global
|
Sets the GitLab connection for the project. Configured via Jenkins Global
|
||||||
Configuration.
|
Configuration.
|
||||||
@ -163,7 +163,7 @@ def gitlab(parser, xml_parent, data):
|
|||||||
raise MissingAttributeError(e)
|
raise MissingAttributeError(e)
|
||||||
|
|
||||||
|
|
||||||
def least_load(parser, xml_parent, data):
|
def least_load(registry, xml_parent, data):
|
||||||
"""yaml: least-load
|
"""yaml: least-load
|
||||||
Enables the Least Load Plugin.
|
Enables the Least Load Plugin.
|
||||||
Requires the Jenkins :jenkins-wiki:`Least Load Plugin <Least+Load+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Least Load Plugin <Least+Load+Plugin>`.
|
||||||
@ -183,7 +183,7 @@ def least_load(parser, xml_parent, data):
|
|||||||
data.get('disabled', True)).lower()
|
data.get('disabled', True)).lower()
|
||||||
|
|
||||||
|
|
||||||
def throttle(parser, xml_parent, data):
|
def throttle(registry, xml_parent, data):
|
||||||
"""yaml: throttle
|
"""yaml: throttle
|
||||||
Throttles the number of builds for this job.
|
Throttles the number of builds for this job.
|
||||||
Requires the Jenkins :jenkins-wiki:`Throttle Concurrent Builds Plugin
|
Requires the Jenkins :jenkins-wiki:`Throttle Concurrent Builds Plugin
|
||||||
@ -235,7 +235,7 @@ def throttle(parser, xml_parent, data):
|
|||||||
data.get('matrix-configs', False)).lower()
|
data.get('matrix-configs', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def sidebar(parser, xml_parent, data):
|
def sidebar(registry, xml_parent, data):
|
||||||
"""yaml: sidebar
|
"""yaml: sidebar
|
||||||
Allows you to add links in the sidebar.
|
Allows you to add links in the sidebar.
|
||||||
Requires the Jenkins :jenkins-wiki:`Sidebar-Link Plugin
|
Requires the Jenkins :jenkins-wiki:`Sidebar-Link Plugin
|
||||||
@ -263,7 +263,7 @@ def sidebar(parser, xml_parent, data):
|
|||||||
XML.SubElement(action, 'icon').text = str(data.get('icon', ''))
|
XML.SubElement(action, 'icon').text = str(data.get('icon', ''))
|
||||||
|
|
||||||
|
|
||||||
def inject(parser, xml_parent, data):
|
def inject(registry, xml_parent, data):
|
||||||
"""yaml: inject
|
"""yaml: inject
|
||||||
Allows you to inject environment variables into the build.
|
Allows you to inject environment variables into the build.
|
||||||
Requires the Jenkins :jenkins-wiki:`Env Inject Plugin <EnvInject+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Env Inject Plugin <EnvInject+Plugin>`.
|
||||||
@ -313,7 +313,7 @@ def inject(parser, xml_parent, data):
|
|||||||
data.get('override-build-parameters', False)).lower()
|
data.get('override-build-parameters', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def authenticated_build(parser, xml_parent, data):
|
def authenticated_build(registry, xml_parent, data):
|
||||||
"""yaml: authenticated-build
|
"""yaml: authenticated-build
|
||||||
Specifies an authorization matrix where only authenticated users
|
Specifies an authorization matrix where only authenticated users
|
||||||
may trigger a build.
|
may trigger a build.
|
||||||
@ -335,7 +335,7 @@ def authenticated_build(parser, xml_parent, data):
|
|||||||
'hudson.model.Item.Build:authenticated')
|
'hudson.model.Item.Build:authenticated')
|
||||||
|
|
||||||
|
|
||||||
def authorization(parser, xml_parent, data):
|
def authorization(registry, xml_parent, data):
|
||||||
"""yaml: authorization
|
"""yaml: authorization
|
||||||
Specifies an authorization matrix
|
Specifies an authorization matrix
|
||||||
|
|
||||||
@ -408,7 +408,7 @@ def authorization(parser, xml_parent, data):
|
|||||||
raise InvalidAttributeError(username, perm, mapping.keys())
|
raise InvalidAttributeError(username, perm, mapping.keys())
|
||||||
|
|
||||||
|
|
||||||
def priority_sorter(parser, xml_parent, data):
|
def priority_sorter(registry, xml_parent, data):
|
||||||
"""yaml: priority-sorter
|
"""yaml: priority-sorter
|
||||||
Allows simple ordering of builds, using a configurable job priority.
|
Allows simple ordering of builds, using a configurable job priority.
|
||||||
|
|
||||||
@ -433,7 +433,7 @@ def priority_sorter(parser, xml_parent, data):
|
|||||||
raise MissingAttributeError(e)
|
raise MissingAttributeError(e)
|
||||||
|
|
||||||
|
|
||||||
def build_blocker(parser, xml_parent, data):
|
def build_blocker(registry, xml_parent, data):
|
||||||
"""yaml: build-blocker
|
"""yaml: build-blocker
|
||||||
This plugin keeps the actual job in the queue
|
This plugin keeps the actual job in the queue
|
||||||
if at least one name of currently running jobs
|
if at least one name of currently running jobs
|
||||||
@ -487,7 +487,7 @@ def build_blocker(parser, xml_parent, data):
|
|||||||
XML.SubElement(blocker, 'scanQueueFor').text = queue_scanning
|
XML.SubElement(blocker, 'scanQueueFor').text = queue_scanning
|
||||||
|
|
||||||
|
|
||||||
def copyartifact(parser, xml_parent, data):
|
def copyartifact(registry, xml_parent, data):
|
||||||
"""yaml: copyartifact
|
"""yaml: copyartifact
|
||||||
Specify a list of projects that have access to copy the artifacts of
|
Specify a list of projects that have access to copy the artifacts of
|
||||||
this project.
|
this project.
|
||||||
@ -518,7 +518,7 @@ def copyartifact(parser, xml_parent, data):
|
|||||||
XML.SubElement(projectlist, 'string').text = project
|
XML.SubElement(projectlist, 'string').text = project
|
||||||
|
|
||||||
|
|
||||||
def batch_tasks(parser, xml_parent, data):
|
def batch_tasks(registry, xml_parent, data):
|
||||||
"""yaml: batch-tasks
|
"""yaml: batch-tasks
|
||||||
Batch tasks can be tasks for events like releases, integration, archiving,
|
Batch tasks can be tasks for events like releases, integration, archiving,
|
||||||
etc. In this way, anyone in the project team can execute them in a way that
|
etc. In this way, anyone in the project team can execute them in a way that
|
||||||
@ -553,7 +553,7 @@ def batch_tasks(parser, xml_parent, data):
|
|||||||
XML.SubElement(batch_task, 'script').text = task['script']
|
XML.SubElement(batch_task, 'script').text = task['script']
|
||||||
|
|
||||||
|
|
||||||
def heavy_job(parser, xml_parent, data):
|
def heavy_job(registry, xml_parent, data):
|
||||||
"""yaml: heavy-job
|
"""yaml: heavy-job
|
||||||
This plugin allows you to define "weight" on each job,
|
This plugin allows you to define "weight" on each job,
|
||||||
and making each job consume that many executors
|
and making each job consume that many executors
|
||||||
@ -576,7 +576,7 @@ def heavy_job(parser, xml_parent, data):
|
|||||||
data.get('weight', 1))
|
data.get('weight', 1))
|
||||||
|
|
||||||
|
|
||||||
def slave_utilization(parser, xml_parent, data):
|
def slave_utilization(registry, xml_parent, data):
|
||||||
"""yaml: slave-utilization
|
"""yaml: slave-utilization
|
||||||
This plugin allows you to specify the percentage of a slave's capacity a
|
This plugin allows you to specify the percentage of a slave's capacity a
|
||||||
job wants to use.
|
job wants to use.
|
||||||
@ -607,7 +607,7 @@ def slave_utilization(parser, xml_parent, data):
|
|||||||
data.get('single-instance-per-slave', False)).lower()
|
data.get('single-instance-per-slave', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def delivery_pipeline(parser, xml_parent, data):
|
def delivery_pipeline(registry, xml_parent, data):
|
||||||
"""yaml: delivery-pipeline
|
"""yaml: delivery-pipeline
|
||||||
Requires the Jenkins :jenkins-wiki:`Delivery Pipeline Plugin
|
Requires the Jenkins :jenkins-wiki:`Delivery Pipeline Plugin
|
||||||
<Delivery+Pipeline+Plugin>`.
|
<Delivery+Pipeline+Plugin>`.
|
||||||
@ -641,7 +641,7 @@ def delivery_pipeline(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(pipeline, data, mapping, fail_required=True)
|
convert_mapping_to_xml(pipeline, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def zeromq_event(parser, xml_parent, data):
|
def zeromq_event(registry, xml_parent, data):
|
||||||
"""yaml: zeromq-event
|
"""yaml: zeromq-event
|
||||||
This is a Jenkins plugin that will publish Jenkins Job run events
|
This is a Jenkins plugin that will publish Jenkins Job run events
|
||||||
(start, complete, finish) to a ZMQ PUB socket.
|
(start, complete, finish) to a ZMQ PUB socket.
|
||||||
@ -663,7 +663,7 @@ def zeromq_event(parser, xml_parent, data):
|
|||||||
XML.SubElement(zmq_event, 'enabled').text = 'true'
|
XML.SubElement(zmq_event, 'enabled').text = 'true'
|
||||||
|
|
||||||
|
|
||||||
def slack(parser, xml_parent, data):
|
def slack(registry, xml_parent, data):
|
||||||
"""yaml: slack
|
"""yaml: slack
|
||||||
Requires the Jenkins :jenkins-wiki:`Slack Plugin <Slack+Plugin>`
|
Requires the Jenkins :jenkins-wiki:`Slack Plugin <Slack+Plugin>`
|
||||||
|
|
||||||
@ -708,7 +708,7 @@ def slack(parser, xml_parent, data):
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
plugin_info = parser.registry.get_plugin_info('Slack Notification Plugin')
|
plugin_info = registry.get_plugin_info('Slack Notification Plugin')
|
||||||
plugin_ver = pkg_resources.parse_version(plugin_info.get('version', "0"))
|
plugin_ver = pkg_resources.parse_version(plugin_info.get('version', "0"))
|
||||||
|
|
||||||
if plugin_ver >= pkg_resources.parse_version("2.0"):
|
if plugin_ver >= pkg_resources.parse_version("2.0"):
|
||||||
@ -746,7 +746,7 @@ def slack(parser, xml_parent, data):
|
|||||||
_add_xml(slack, xml_name, data.get(yaml_name, default_value))
|
_add_xml(slack, xml_name, data.get(yaml_name, default_value))
|
||||||
|
|
||||||
|
|
||||||
def rebuild(parser, xml_parent, data):
|
def rebuild(registry, xml_parent, data):
|
||||||
"""yaml: rebuild
|
"""yaml: rebuild
|
||||||
Requires the Jenkins :jenkins-wiki:`Rebuild Plugin
|
Requires the Jenkins :jenkins-wiki:`Rebuild Plugin
|
||||||
<Rebuild+Plugin>`.
|
<Rebuild+Plugin>`.
|
||||||
@ -771,7 +771,7 @@ def rebuild(parser, xml_parent, data):
|
|||||||
data.get('rebuild-disabled', False)).lower()
|
data.get('rebuild-disabled', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def build_discarder(parser, xml_parent, data):
|
def build_discarder(registry, xml_parent, data):
|
||||||
"""yaml: build-discarder
|
"""yaml: build-discarder
|
||||||
|
|
||||||
:arg int days-to-keep: Number of days to keep builds for (default -1)
|
:arg int days-to-keep: Number of days to keep builds for (default -1)
|
||||||
@ -811,10 +811,10 @@ class Properties(jenkins_jobs.modules.base.Base):
|
|||||||
component_type = 'property'
|
component_type = 'property'
|
||||||
component_list_type = 'properties'
|
component_list_type = 'properties'
|
||||||
|
|
||||||
def gen_xml(self, parser, xml_parent, data):
|
def gen_xml(self, xml_parent, data):
|
||||||
properties = xml_parent.find('properties')
|
properties = xml_parent.find('properties')
|
||||||
if properties is None:
|
if properties is None:
|
||||||
properties = XML.SubElement(xml_parent, 'properties')
|
properties = XML.SubElement(xml_parent, 'properties')
|
||||||
|
|
||||||
for prop in data.get('properties', []):
|
for prop in data.get('properties', []):
|
||||||
self.registry.dispatch('property', parser, properties, prop)
|
self.registry.dispatch('property', properties, prop)
|
||||||
|
@ -41,7 +41,7 @@ from jenkins_jobs.modules import hudson_model
|
|||||||
import jenkins_jobs.modules.helpers as helpers
|
import jenkins_jobs.modules.helpers as helpers
|
||||||
|
|
||||||
|
|
||||||
def archive(parser, xml_parent, data):
|
def archive(registry, xml_parent, data):
|
||||||
"""yaml: archive
|
"""yaml: archive
|
||||||
Archive build artifacts
|
Archive build artifacts
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ def archive(parser, xml_parent, data):
|
|||||||
default_excludes.text = str(data.get('default-excludes', True)).lower()
|
default_excludes.text = str(data.get('default-excludes', True)).lower()
|
||||||
|
|
||||||
|
|
||||||
def blame_upstream(parser, xml_parent, data):
|
def blame_upstream(registry, xml_parent, data):
|
||||||
"""yaml: blame-upstream
|
"""yaml: blame-upstream
|
||||||
Notify upstream commiters when build fails
|
Notify upstream commiters when build fails
|
||||||
Requires the Jenkins :jenkins-wiki:`Blame upstream commiters Plugin
|
Requires the Jenkins :jenkins-wiki:`Blame upstream commiters Plugin
|
||||||
@ -115,7 +115,7 @@ def blame_upstream(parser, xml_parent, data):
|
|||||||
'BlameUpstreamCommitersPublisher')
|
'BlameUpstreamCommitersPublisher')
|
||||||
|
|
||||||
|
|
||||||
def jclouds(parser, xml_parent, data):
|
def jclouds(registry, xml_parent, data):
|
||||||
"""yaml: jclouds
|
"""yaml: jclouds
|
||||||
JClouds Cloud Storage Settings provides a way to store artifacts on
|
JClouds Cloud Storage Settings provides a way to store artifacts on
|
||||||
JClouds supported storage providers. Requires the Jenkins
|
JClouds supported storage providers. Requires the Jenkins
|
||||||
@ -161,7 +161,7 @@ def jclouds(parser, xml_parent, data):
|
|||||||
data.get('hierarchy', False)).lower()
|
data.get('hierarchy', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def javadoc(parser, xml_parent, data):
|
def javadoc(registry, xml_parent, data):
|
||||||
"""yaml: javadoc
|
"""yaml: javadoc
|
||||||
Publish Javadoc
|
Publish Javadoc
|
||||||
Requires the Jenkins :jenkins-wiki:`Javadoc Plugin <Javadoc+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Javadoc Plugin <Javadoc+Plugin>`.
|
||||||
@ -187,7 +187,7 @@ def javadoc(parser, xml_parent, data):
|
|||||||
'keep-all-successful', False)).lower()
|
'keep-all-successful', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def jdepend(parser, xml_parent, data):
|
def jdepend(registry, xml_parent, data):
|
||||||
"""yaml: jdepend
|
"""yaml: jdepend
|
||||||
Publish jdepend report
|
Publish jdepend report
|
||||||
Requires the :jenkins-wiki:`JDepend Plugin <JDepend+Plugin>`.
|
Requires the :jenkins-wiki:`JDepend Plugin <JDepend+Plugin>`.
|
||||||
@ -208,7 +208,7 @@ def jdepend(parser, xml_parent, data):
|
|||||||
XML.SubElement(jdepend, 'configuredJDependFile').text = str(filepath)
|
XML.SubElement(jdepend, 'configuredJDependFile').text = str(filepath)
|
||||||
|
|
||||||
|
|
||||||
def hue_light(parser, xml_parent, data):
|
def hue_light(registry, xml_parent, data):
|
||||||
"""yaml: hue-light
|
"""yaml: hue-light
|
||||||
This plugin shows the state of your builds using the awesome Philips hue
|
This plugin shows the state of your builds using the awesome Philips hue
|
||||||
lights.
|
lights.
|
||||||
@ -253,7 +253,7 @@ def hue_light(parser, xml_parent, data):
|
|||||||
hue_light, data, build_mapping, fail_required=True)
|
hue_light, data, build_mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def campfire(parser, xml_parent, data):
|
def campfire(registry, xml_parent, data):
|
||||||
"""yaml: campfire
|
"""yaml: campfire
|
||||||
Send build notifications to Campfire rooms.
|
Send build notifications to Campfire rooms.
|
||||||
Requires the Jenkins :jenkins-wiki:`Campfire Plugin <Campfire+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Campfire Plugin <Campfire+Plugin>`.
|
||||||
@ -297,7 +297,7 @@ def campfire(parser, xml_parent, data):
|
|||||||
XML.SubElement(room, 'campfire reference="../../campfire"')
|
XML.SubElement(room, 'campfire reference="../../campfire"')
|
||||||
|
|
||||||
|
|
||||||
def codecover(parser, xml_parent, data):
|
def codecover(registry, xml_parent, data):
|
||||||
"""yaml: codecover
|
"""yaml: codecover
|
||||||
This plugin allows you to capture code coverage report from CodeCover.
|
This plugin allows you to capture code coverage report from CodeCover.
|
||||||
Jenkins will generate the trend report of coverage.
|
Jenkins will generate the trend report of coverage.
|
||||||
@ -346,7 +346,7 @@ def codecover(parser, xml_parent, data):
|
|||||||
health_report, data, mapping, fail_required=True)
|
health_report, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def emotional_jenkins(parser, xml_parent, data):
|
def emotional_jenkins(registry, xml_parent, data):
|
||||||
"""yaml: emotional-jenkins
|
"""yaml: emotional-jenkins
|
||||||
Emotional Jenkins. This funny plugin changes the expression of Mr. Jenkins
|
Emotional Jenkins. This funny plugin changes the expression of Mr. Jenkins
|
||||||
in the background when your builds fail.
|
in the background when your builds fail.
|
||||||
@ -364,7 +364,7 @@ def emotional_jenkins(parser, xml_parent, data):
|
|||||||
'EmotionalJenkinsPublisher')
|
'EmotionalJenkinsPublisher')
|
||||||
|
|
||||||
|
|
||||||
def trigger_parameterized_builds(parser, xml_parent, data):
|
def trigger_parameterized_builds(registry, xml_parent, data):
|
||||||
"""yaml: trigger-parameterized-builds
|
"""yaml: trigger-parameterized-builds
|
||||||
Trigger parameterized builds of other jobs.
|
Trigger parameterized builds of other jobs.
|
||||||
Requires the Jenkins :jenkins-wiki:`Parameterized Trigger Plugin
|
Requires the Jenkins :jenkins-wiki:`Parameterized Trigger Plugin
|
||||||
@ -457,8 +457,8 @@ def trigger_parameterized_builds(parser, xml_parent, data):
|
|||||||
]
|
]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if parser.jjb_config.config_parser.getboolean('__future__',
|
if registry.jjb_config.config_parser.getboolean(
|
||||||
'param_order_from_yaml'):
|
'__future__', 'param_order_from_yaml'):
|
||||||
orig_order = None
|
orig_order = None
|
||||||
except six.moves.configparser.NoSectionError:
|
except six.moves.configparser.NoSectionError:
|
||||||
pass
|
pass
|
||||||
@ -586,7 +586,7 @@ def trigger_parameterized_builds(parser, xml_parent, data):
|
|||||||
project_def.get('trigger-with-no-params', False)).lower()
|
project_def.get('trigger-with-no-params', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def trigger(parser, xml_parent, data):
|
def trigger(registry, xml_parent, data):
|
||||||
"""yaml: trigger
|
"""yaml: trigger
|
||||||
Trigger non-parametrised builds of other jobs.
|
Trigger non-parametrised builds of other jobs.
|
||||||
|
|
||||||
@ -617,7 +617,7 @@ def trigger(parser, xml_parent, data):
|
|||||||
tcolor.text = hudson_model.THRESHOLDS[threshold]['color']
|
tcolor.text = hudson_model.THRESHOLDS[threshold]['color']
|
||||||
|
|
||||||
|
|
||||||
def clone_workspace(parser, xml_parent, data):
|
def clone_workspace(registry, xml_parent, data):
|
||||||
"""yaml: clone-workspace
|
"""yaml: clone-workspace
|
||||||
Archive the workspace from builds of one project and reuse them as the SCM
|
Archive the workspace from builds of one project and reuse them as the SCM
|
||||||
source for another project.
|
source for another project.
|
||||||
@ -689,7 +689,7 @@ def clone_workspace(parser, xml_parent, data):
|
|||||||
override_default_excludes_elem.text = override_default_excludes_str
|
override_default_excludes_elem.text = override_default_excludes_str
|
||||||
|
|
||||||
|
|
||||||
def cloverphp(parser, xml_parent, data):
|
def cloverphp(registry, xml_parent, data):
|
||||||
"""yaml: cloverphp
|
"""yaml: cloverphp
|
||||||
Capture code coverage reports from PHPUnit
|
Capture code coverage reports from PHPUnit
|
||||||
Requires the Jenkins :jenkins-wiki:`Clover PHP Plugin <Clover+PHP+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Clover PHP Plugin <Clover+PHP+Plugin>`.
|
||||||
@ -795,7 +795,7 @@ def cloverphp(parser, xml_parent, data):
|
|||||||
XML.SubElement(cur_target, t_type + 'Coverage').text = str(val)
|
XML.SubElement(cur_target, t_type + 'Coverage').text = str(val)
|
||||||
|
|
||||||
|
|
||||||
def coverage(parser, xml_parent, data):
|
def coverage(registry, xml_parent, data):
|
||||||
"""yaml: coverage
|
"""yaml: coverage
|
||||||
WARNING: The coverage function is deprecated. Instead, use the
|
WARNING: The coverage function is deprecated. Instead, use the
|
||||||
cobertura function to generate a cobertura coverage report.
|
cobertura function to generate a cobertura coverage report.
|
||||||
@ -865,7 +865,7 @@ def coverage(parser, xml_parent, data):
|
|||||||
XML.SubElement(cobertura, 'sourceEncoding').text = 'ASCII'
|
XML.SubElement(cobertura, 'sourceEncoding').text = 'ASCII'
|
||||||
|
|
||||||
|
|
||||||
def cobertura(parser, xml_parent, data):
|
def cobertura(registry, xml_parent, data):
|
||||||
"""yaml: cobertura
|
"""yaml: cobertura
|
||||||
Generate a cobertura coverage report.
|
Generate a cobertura coverage report.
|
||||||
Requires the Jenkins :jenkins-wiki:`Cobertura Coverage Plugin
|
Requires the Jenkins :jenkins-wiki:`Cobertura Coverage Plugin
|
||||||
@ -953,7 +953,7 @@ def cobertura(parser, xml_parent, data):
|
|||||||
'source-encoding', 'ASCII')
|
'source-encoding', 'ASCII')
|
||||||
|
|
||||||
|
|
||||||
def jacoco(parser, xml_parent, data):
|
def jacoco(registry, xml_parent, data):
|
||||||
"""yaml: jacoco
|
"""yaml: jacoco
|
||||||
Generate a JaCoCo coverage report.
|
Generate a JaCoCo coverage report.
|
||||||
Requires the Jenkins :jenkins-wiki:`JaCoCo Plugin <JaCoCo+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`JaCoCo Plugin <JaCoCo+Plugin>`.
|
||||||
@ -1023,7 +1023,7 @@ def jacoco(parser, xml_parent, data):
|
|||||||
'Coverage').text = str(item_values.get('unhealthy', 0))
|
'Coverage').text = str(item_values.get('unhealthy', 0))
|
||||||
|
|
||||||
|
|
||||||
def ftp(parser, xml_parent, data):
|
def ftp(registry, xml_parent, data):
|
||||||
"""yaml: ftp
|
"""yaml: ftp
|
||||||
Upload files via FTP.
|
Upload files via FTP.
|
||||||
Requires the Jenkins :jenkins-wiki:`Publish over FTP Plugin
|
Requires the Jenkins :jenkins-wiki:`Publish over FTP Plugin
|
||||||
@ -1065,7 +1065,7 @@ def ftp(parser, xml_parent, data):
|
|||||||
XML.SubElement(transfer_node, 'asciiMode').text = 'false'
|
XML.SubElement(transfer_node, 'asciiMode').text = 'false'
|
||||||
|
|
||||||
|
|
||||||
def junit(parser, xml_parent, data):
|
def junit(registry, xml_parent, data):
|
||||||
"""yaml: junit
|
"""yaml: junit
|
||||||
Publish JUnit test results.
|
Publish JUnit test results.
|
||||||
|
|
||||||
@ -1131,7 +1131,7 @@ def junit(parser, xml_parent, data):
|
|||||||
'.JUnitFlakyTestDataPublisher')
|
'.JUnitFlakyTestDataPublisher')
|
||||||
|
|
||||||
|
|
||||||
def cucumber_reports(parser, xml_parent, data):
|
def cucumber_reports(registry, xml_parent, data):
|
||||||
"""yaml: cucumber-reports
|
"""yaml: cucumber-reports
|
||||||
This plugin creates pretty cucumber-jvm html reports on jenkins.
|
This plugin creates pretty cucumber-jvm html reports on jenkins.
|
||||||
|
|
||||||
@ -1195,7 +1195,7 @@ def cucumber_reports(parser, xml_parent, data):
|
|||||||
cucumber_reports, data, mappings, fail_required=True)
|
cucumber_reports, data, mappings, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def cucumber_testresult(parser, xml_parent, data):
|
def cucumber_testresult(registry, xml_parent, data):
|
||||||
"""yaml: cucumber-testresult
|
"""yaml: cucumber-testresult
|
||||||
Publish cucumber test results.
|
Publish cucumber test results.
|
||||||
Requires the Jenkins :jenkins-wiki:`cucumber testresult
|
Requires the Jenkins :jenkins-wiki:`cucumber testresult
|
||||||
@ -1220,7 +1220,7 @@ def cucumber_testresult(parser, xml_parent, data):
|
|||||||
XML.SubElement(cucumber_result, 'testResults').text = str(filepath)
|
XML.SubElement(cucumber_result, 'testResults').text = str(filepath)
|
||||||
|
|
||||||
|
|
||||||
def xunit(parser, xml_parent, data):
|
def xunit(registry, xml_parent, data):
|
||||||
"""yaml: xunit
|
"""yaml: xunit
|
||||||
Publish tests results. Requires the Jenkins :jenkins-wiki:`xUnit Plugin
|
Publish tests results. Requires the Jenkins :jenkins-wiki:`xUnit Plugin
|
||||||
<xUnit+Plugin>`.
|
<xUnit+Plugin>`.
|
||||||
@ -1375,7 +1375,7 @@ def _violations_add_entry(xml_parent, name, data):
|
|||||||
XML.SubElement(tconfig, 'pattern')
|
XML.SubElement(tconfig, 'pattern')
|
||||||
|
|
||||||
|
|
||||||
def violations(parser, xml_parent, data):
|
def violations(registry, xml_parent, data):
|
||||||
"""yaml: violations
|
"""yaml: violations
|
||||||
Publish code style violations.
|
Publish code style violations.
|
||||||
Requires the Jenkins :jenkins-wiki:`Violations Plugin <Violations>`.
|
Requires the Jenkins :jenkins-wiki:`Violations Plugin <Violations>`.
|
||||||
@ -1436,7 +1436,7 @@ def violations(parser, xml_parent, data):
|
|||||||
XML.SubElement(config, 'encoding').text = 'default'
|
XML.SubElement(config, 'encoding').text = 'default'
|
||||||
|
|
||||||
|
|
||||||
def findbugs(parser, xml_parent, data):
|
def findbugs(registry, xml_parent, data):
|
||||||
"""yaml: findbugs
|
"""yaml: findbugs
|
||||||
FindBugs reporting for builds
|
FindBugs reporting for builds
|
||||||
|
|
||||||
@ -1505,7 +1505,7 @@ def findbugs(parser, xml_parent, data):
|
|||||||
helpers.build_trends_publisher('[FINDBUGS] ', findbugs, data)
|
helpers.build_trends_publisher('[FINDBUGS] ', findbugs, data)
|
||||||
|
|
||||||
|
|
||||||
def checkstyle(parser, xml_parent, data):
|
def checkstyle(registry, xml_parent, data):
|
||||||
"""yaml: checkstyle
|
"""yaml: checkstyle
|
||||||
Publish trend reports with Checkstyle.
|
Publish trend reports with Checkstyle.
|
||||||
Requires the Jenkins :jenkins-wiki:`Checkstyle Plugin <Checkstyle+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Checkstyle Plugin <Checkstyle+Plugin>`.
|
||||||
@ -1603,7 +1603,7 @@ def checkstyle(parser, xml_parent, data):
|
|||||||
helpers.build_trends_publisher('[CHECKSTYLE] ', xml_element, data)
|
helpers.build_trends_publisher('[CHECKSTYLE] ', xml_element, data)
|
||||||
|
|
||||||
|
|
||||||
def scp(parser, xml_parent, data):
|
def scp(registry, xml_parent, data):
|
||||||
"""yaml: scp
|
"""yaml: scp
|
||||||
Upload files via SCP
|
Upload files via SCP
|
||||||
Requires the Jenkins :jenkins-wiki:`SCP Plugin <SCP+plugin>`.
|
Requires the Jenkins :jenkins-wiki:`SCP Plugin <SCP+plugin>`.
|
||||||
@ -1669,7 +1669,7 @@ def scp(parser, xml_parent, data):
|
|||||||
XML.SubElement(entry_e, 'copyAfterFailure').text = 'false'
|
XML.SubElement(entry_e, 'copyAfterFailure').text = 'false'
|
||||||
|
|
||||||
|
|
||||||
def ssh(parser, xml_parent, data):
|
def ssh(registry, xml_parent, data):
|
||||||
"""yaml: ssh
|
"""yaml: ssh
|
||||||
Upload files via SCP.
|
Upload files via SCP.
|
||||||
Requires the Jenkins :jenkins-wiki:`Publish over SSH Plugin
|
Requires the Jenkins :jenkins-wiki:`Publish over SSH Plugin
|
||||||
@ -1714,7 +1714,7 @@ def ssh(parser, xml_parent, data):
|
|||||||
publisher_tag, transfer_tag, reference_tag)
|
publisher_tag, transfer_tag, reference_tag)
|
||||||
|
|
||||||
|
|
||||||
def pipeline(parser, xml_parent, data):
|
def pipeline(registry, xml_parent, data):
|
||||||
"""yaml: pipeline
|
"""yaml: pipeline
|
||||||
Specify a downstream project in a pipeline.
|
Specify a downstream project in a pipeline.
|
||||||
Requires the Jenkins :jenkins-wiki:`Build Pipeline Plugin
|
Requires the Jenkins :jenkins-wiki:`Build Pipeline Plugin
|
||||||
@ -1787,7 +1787,7 @@ def pipeline(parser, xml_parent, data):
|
|||||||
XML.SubElement(pippub, 'downstreamProjectNames').text = data['project']
|
XML.SubElement(pippub, 'downstreamProjectNames').text = data['project']
|
||||||
|
|
||||||
|
|
||||||
def email(parser, xml_parent, data):
|
def email(registry, xml_parent, data):
|
||||||
"""yaml: email
|
"""yaml: email
|
||||||
Email notifications on build failure.
|
Email notifications on build failure.
|
||||||
Requires the Jenkins :jenkins-wiki:`Mailer Plugin
|
Requires the Jenkins :jenkins-wiki:`Mailer Plugin
|
||||||
@ -1828,7 +1828,7 @@ def email(parser, xml_parent, data):
|
|||||||
data.get('send-to-individuals', False)).lower()
|
data.get('send-to-individuals', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def claim_build(parser, xml_parent, data):
|
def claim_build(registry, xml_parent, data):
|
||||||
"""yaml: claim-build
|
"""yaml: claim-build
|
||||||
Claim build failures
|
Claim build failures
|
||||||
Requires the Jenkins :jenkins-wiki:`Claim Plugin <Claim+plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Claim Plugin <Claim+plugin>`.
|
||||||
@ -1842,7 +1842,7 @@ def claim_build(parser, xml_parent, data):
|
|||||||
XML.SubElement(xml_parent, 'hudson.plugins.claim.ClaimPublisher')
|
XML.SubElement(xml_parent, 'hudson.plugins.claim.ClaimPublisher')
|
||||||
|
|
||||||
|
|
||||||
def base_email_ext(parser, xml_parent, data, ttype):
|
def base_email_ext(registry, xml_parent, data, ttype):
|
||||||
trigger = XML.SubElement(xml_parent,
|
trigger = XML.SubElement(xml_parent,
|
||||||
'hudson.plugins.emailext.plugins.trigger.'
|
'hudson.plugins.emailext.plugins.trigger.'
|
||||||
+ ttype)
|
+ ttype)
|
||||||
@ -1866,7 +1866,7 @@ def base_email_ext(parser, xml_parent, data, ttype):
|
|||||||
XML.SubElement(email, 'sendToRecipientList').text = 'true'
|
XML.SubElement(email, 'sendToRecipientList').text = 'true'
|
||||||
|
|
||||||
|
|
||||||
def email_ext(parser, xml_parent, data):
|
def email_ext(registry, xml_parent, data):
|
||||||
"""yaml: email-ext
|
"""yaml: email-ext
|
||||||
Extend Jenkin's built in email notification
|
Extend Jenkin's built in email notification
|
||||||
Requires the Jenkins :jenkins-wiki:`Email-ext Plugin
|
Requires the Jenkins :jenkins-wiki:`Email-ext Plugin
|
||||||
@ -1942,33 +1942,33 @@ def email_ext(parser, xml_parent, data):
|
|||||||
XML.SubElement(emailext, 'recipientList').text = '$DEFAULT_RECIPIENTS'
|
XML.SubElement(emailext, 'recipientList').text = '$DEFAULT_RECIPIENTS'
|
||||||
ctrigger = XML.SubElement(emailext, 'configuredTriggers')
|
ctrigger = XML.SubElement(emailext, 'configuredTriggers')
|
||||||
if data.get('always', False):
|
if data.get('always', False):
|
||||||
base_email_ext(parser, ctrigger, data, 'AlwaysTrigger')
|
base_email_ext(registry, ctrigger, data, 'AlwaysTrigger')
|
||||||
if data.get('unstable', False):
|
if data.get('unstable', False):
|
||||||
base_email_ext(parser, ctrigger, data, 'UnstableTrigger')
|
base_email_ext(registry, ctrigger, data, 'UnstableTrigger')
|
||||||
if data.get('first-failure', False):
|
if data.get('first-failure', False):
|
||||||
base_email_ext(parser, ctrigger, data, 'FirstFailureTrigger')
|
base_email_ext(registry, ctrigger, data, 'FirstFailureTrigger')
|
||||||
if data.get('not-built', False):
|
if data.get('not-built', False):
|
||||||
base_email_ext(parser, ctrigger, data, 'NotBuiltTrigger')
|
base_email_ext(registry, ctrigger, data, 'NotBuiltTrigger')
|
||||||
if data.get('aborted', False):
|
if data.get('aborted', False):
|
||||||
base_email_ext(parser, ctrigger, data, 'AbortedTrigger')
|
base_email_ext(registry, ctrigger, data, 'AbortedTrigger')
|
||||||
if data.get('regression', False):
|
if data.get('regression', False):
|
||||||
base_email_ext(parser, ctrigger, data, 'RegressionTrigger')
|
base_email_ext(registry, ctrigger, data, 'RegressionTrigger')
|
||||||
if data.get('failure', True):
|
if data.get('failure', True):
|
||||||
base_email_ext(parser, ctrigger, data, 'FailureTrigger')
|
base_email_ext(registry, ctrigger, data, 'FailureTrigger')
|
||||||
if data.get('second-failure', False):
|
if data.get('second-failure', False):
|
||||||
base_email_ext(parser, ctrigger, data, 'SecondFailureTrigger')
|
base_email_ext(registry, ctrigger, data, 'SecondFailureTrigger')
|
||||||
if data.get('improvement', False):
|
if data.get('improvement', False):
|
||||||
base_email_ext(parser, ctrigger, data, 'ImprovementTrigger')
|
base_email_ext(registry, ctrigger, data, 'ImprovementTrigger')
|
||||||
if data.get('still-failing', False):
|
if data.get('still-failing', False):
|
||||||
base_email_ext(parser, ctrigger, data, 'StillFailingTrigger')
|
base_email_ext(registry, ctrigger, data, 'StillFailingTrigger')
|
||||||
if data.get('success', False):
|
if data.get('success', False):
|
||||||
base_email_ext(parser, ctrigger, data, 'SuccessTrigger')
|
base_email_ext(registry, ctrigger, data, 'SuccessTrigger')
|
||||||
if data.get('fixed', False):
|
if data.get('fixed', False):
|
||||||
base_email_ext(parser, ctrigger, data, 'FixedTrigger')
|
base_email_ext(registry, ctrigger, data, 'FixedTrigger')
|
||||||
if data.get('still-unstable', False):
|
if data.get('still-unstable', False):
|
||||||
base_email_ext(parser, ctrigger, data, 'StillUnstableTrigger')
|
base_email_ext(registry, ctrigger, data, 'StillUnstableTrigger')
|
||||||
if data.get('pre-build', False):
|
if data.get('pre-build', False):
|
||||||
base_email_ext(parser, ctrigger, data, 'PreBuildTrigger')
|
base_email_ext(registry, ctrigger, data, 'PreBuildTrigger')
|
||||||
|
|
||||||
content_type_mime = {
|
content_type_mime = {
|
||||||
'text': 'text/plain',
|
'text': 'text/plain',
|
||||||
@ -2014,7 +2014,7 @@ def email_ext(parser, xml_parent, data):
|
|||||||
matrix_dict.get(matrix_trigger)
|
matrix_dict.get(matrix_trigger)
|
||||||
|
|
||||||
|
|
||||||
def fingerprint(parser, xml_parent, data):
|
def fingerprint(registry, xml_parent, data):
|
||||||
"""yaml: fingerprint
|
"""yaml: fingerprint
|
||||||
Fingerprint files to track them across builds
|
Fingerprint files to track them across builds
|
||||||
|
|
||||||
@ -2034,7 +2034,7 @@ def fingerprint(parser, xml_parent, data):
|
|||||||
'record-artifacts', False)).lower()
|
'record-artifacts', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def aggregate_tests(parser, xml_parent, data):
|
def aggregate_tests(registry, xml_parent, data):
|
||||||
"""yaml: aggregate-tests
|
"""yaml: aggregate-tests
|
||||||
Aggregate downstream test results
|
Aggregate downstream test results
|
||||||
|
|
||||||
@ -2052,7 +2052,7 @@ def aggregate_tests(parser, xml_parent, data):
|
|||||||
'include-failed-builds', False)).lower()
|
'include-failed-builds', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def aggregate_flow_tests(parser, xml_parent, data):
|
def aggregate_flow_tests(registry, xml_parent, data):
|
||||||
"""yaml: aggregate-flow-tests
|
"""yaml: aggregate-flow-tests
|
||||||
Aggregate downstream test results in a Build Flow job.
|
Aggregate downstream test results in a Build Flow job.
|
||||||
Requires the Jenkins :jenkins-wiki:`Build Flow Test Aggregator Plugin
|
Requires the Jenkins :jenkins-wiki:`Build Flow Test Aggregator Plugin
|
||||||
@ -2074,7 +2074,7 @@ def aggregate_flow_tests(parser, xml_parent, data):
|
|||||||
data.get('show-test-results-trend', True)).lower()
|
data.get('show-test-results-trend', True)).lower()
|
||||||
|
|
||||||
|
|
||||||
def cppcheck(parser, xml_parent, data):
|
def cppcheck(registry, xml_parent, data):
|
||||||
"""yaml: cppcheck
|
"""yaml: cppcheck
|
||||||
Cppcheck result publisher
|
Cppcheck result publisher
|
||||||
Requires the Jenkins :jenkins-wiki:`Cppcheck Plugin <Cppcheck+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Cppcheck Plugin <Cppcheck+Plugin>`.
|
||||||
@ -2140,7 +2140,7 @@ def cppcheck(parser, xml_parent, data):
|
|||||||
str(gdisplay.get('information', False)).lower()
|
str(gdisplay.get('information', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def logparser(parser, xml_parent, data):
|
def logparser(registry, xml_parent, data):
|
||||||
"""yaml: logparser
|
"""yaml: logparser
|
||||||
Requires the Jenkins :jenkins-wiki:`Log Parser Plugin <Log+Parser+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Log Parser Plugin <Log+Parser+Plugin>`.
|
||||||
|
|
||||||
@ -2164,7 +2164,7 @@ def logparser(parser, xml_parent, data):
|
|||||||
XML.SubElement(clog, 'parsingRulesPath').text = data.get('parse-rules', '')
|
XML.SubElement(clog, 'parsingRulesPath').text = data.get('parse-rules', '')
|
||||||
|
|
||||||
|
|
||||||
def copy_to_master(parser, xml_parent, data):
|
def copy_to_master(registry, xml_parent, data):
|
||||||
"""yaml: copy-to-master
|
"""yaml: copy-to-master
|
||||||
Copy files to master from slave
|
Copy files to master from slave
|
||||||
Requires the Jenkins :jenkins-wiki:`Copy To Slave Plugin
|
Requires the Jenkins :jenkins-wiki:`Copy To Slave Plugin
|
||||||
@ -2195,7 +2195,7 @@ def copy_to_master(parser, xml_parent, data):
|
|||||||
XML.SubElement(cm, 'overrideDestinationFolder').text = 'true'
|
XML.SubElement(cm, 'overrideDestinationFolder').text = 'true'
|
||||||
|
|
||||||
|
|
||||||
def jira(parser, xml_parent, data):
|
def jira(registry, xml_parent, data):
|
||||||
"""yaml: jira
|
"""yaml: jira
|
||||||
Update relevant JIRA issues
|
Update relevant JIRA issues
|
||||||
Requires the Jenkins :jenkins-wiki:`JIRA Plugin <JIRA+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`JIRA Plugin <JIRA+Plugin>`.
|
||||||
@ -2208,7 +2208,7 @@ def jira(parser, xml_parent, data):
|
|||||||
XML.SubElement(xml_parent, 'hudson.plugins.jira.JiraIssueUpdater')
|
XML.SubElement(xml_parent, 'hudson.plugins.jira.JiraIssueUpdater')
|
||||||
|
|
||||||
|
|
||||||
def growl(parser, xml_parent, data):
|
def growl(registry, xml_parent, data):
|
||||||
"""yaml: growl
|
"""yaml: growl
|
||||||
Push notifications to growl client.
|
Push notifications to growl client.
|
||||||
Requires the Jenkins :jenkins-wiki:`Growl Plugin <Growl+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Growl Plugin <Growl+Plugin>`.
|
||||||
@ -2237,7 +2237,7 @@ def growl(parser, xml_parent, data):
|
|||||||
helpers.convert_mapping_to_xml(growl, data, mapping, fail_required=True)
|
helpers.convert_mapping_to_xml(growl, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def groovy_postbuild(parser, xml_parent, data):
|
def groovy_postbuild(registry, xml_parent, data):
|
||||||
"""yaml: groovy-postbuild
|
"""yaml: groovy-postbuild
|
||||||
Execute a groovy script.
|
Execute a groovy script.
|
||||||
Requires the Jenkins :jenkins-wiki:`Groovy Postbuild Plugin
|
Requires the Jenkins :jenkins-wiki:`Groovy Postbuild Plugin
|
||||||
@ -2277,7 +2277,7 @@ def groovy_postbuild(parser, xml_parent, data):
|
|||||||
'script': data,
|
'script': data,
|
||||||
}
|
}
|
||||||
# There are incompatible changes, we need to know version
|
# There are incompatible changes, we need to know version
|
||||||
info = parser.registry.get_plugin_info('groovy-postbuild')
|
info = registry.get_plugin_info('groovy-postbuild')
|
||||||
version = pkg_resources.parse_version(info.get('version', "0"))
|
version = pkg_resources.parse_version(info.get('version', "0"))
|
||||||
# Version specific predicates
|
# Version specific predicates
|
||||||
matrix_parent_support = version >= pkg_resources.parse_version("1.9")
|
matrix_parent_support = version >= pkg_resources.parse_version("1.9")
|
||||||
@ -2379,7 +2379,7 @@ def base_publish_over(xml_parent, data, console_prefix,
|
|||||||
return (outer, transfersset)
|
return (outer, transfersset)
|
||||||
|
|
||||||
|
|
||||||
def cifs(parser, xml_parent, data):
|
def cifs(registry, xml_parent, data):
|
||||||
"""yaml: cifs
|
"""yaml: cifs
|
||||||
Upload files via CIFS.
|
Upload files via CIFS.
|
||||||
Requires the Jenkins :jenkins-wiki:`Publish over CIFS Plugin
|
Requires the Jenkins :jenkins-wiki:`Publish over CIFS Plugin
|
||||||
@ -2420,7 +2420,7 @@ def cifs(parser, xml_parent, data):
|
|||||||
plugin_reference_tag)
|
plugin_reference_tag)
|
||||||
|
|
||||||
|
|
||||||
def cigame(parser, xml_parent, data):
|
def cigame(registry, xml_parent, data):
|
||||||
"""yaml: cigame
|
"""yaml: cigame
|
||||||
This plugin introduces a game where users get points
|
This plugin introduces a game where users get points
|
||||||
for improving the builds.
|
for improving the builds.
|
||||||
@ -2435,7 +2435,7 @@ def cigame(parser, xml_parent, data):
|
|||||||
XML.SubElement(xml_parent, 'hudson.plugins.cigame.GamePublisher')
|
XML.SubElement(xml_parent, 'hudson.plugins.cigame.GamePublisher')
|
||||||
|
|
||||||
|
|
||||||
def sonar(parser, xml_parent, data):
|
def sonar(registry, xml_parent, data):
|
||||||
"""yaml: sonar
|
"""yaml: sonar
|
||||||
Sonar plugin support.
|
Sonar plugin support.
|
||||||
Requires the Jenkins `Sonar Plugin.
|
Requires the Jenkins `Sonar Plugin.
|
||||||
@ -2498,7 +2498,7 @@ def sonar(parser, xml_parent, data):
|
|||||||
helpers.config_file_provider_settings(sonar, data)
|
helpers.config_file_provider_settings(sonar, data)
|
||||||
|
|
||||||
|
|
||||||
def performance(parser, xml_parent, data):
|
def performance(registry, xml_parent, data):
|
||||||
"""yaml: performance
|
"""yaml: performance
|
||||||
Publish performance test results from jmeter and junit.
|
Publish performance test results from jmeter and junit.
|
||||||
Requires the Jenkins :jenkins-wiki:`Performance Plugin
|
Requires the Jenkins :jenkins-wiki:`Performance Plugin
|
||||||
@ -2566,7 +2566,7 @@ def performance(parser, xml_parent, data):
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def join_trigger(parser, xml_parent, data):
|
def join_trigger(registry, xml_parent, data):
|
||||||
"""yaml: join-trigger
|
"""yaml: join-trigger
|
||||||
Trigger a job after all the immediate downstream jobs have completed
|
Trigger a job after all the immediate downstream jobs have completed
|
||||||
|
|
||||||
@ -2588,14 +2588,14 @@ def join_trigger(parser, xml_parent, data):
|
|||||||
|
|
||||||
publishers = XML.SubElement(jointrigger, 'joinPublishers')
|
publishers = XML.SubElement(jointrigger, 'joinPublishers')
|
||||||
for pub in data.get('publishers', []):
|
for pub in data.get('publishers', []):
|
||||||
for edited_node in create_publishers(parser, pub):
|
for edited_node in create_publishers(registry, pub):
|
||||||
publishers.append(edited_node)
|
publishers.append(edited_node)
|
||||||
|
|
||||||
unstable = str(data.get('even-if-unstable', 'false')).lower()
|
unstable = str(data.get('even-if-unstable', 'false')).lower()
|
||||||
XML.SubElement(jointrigger, 'evenIfDownstreamUnstable').text = unstable
|
XML.SubElement(jointrigger, 'evenIfDownstreamUnstable').text = unstable
|
||||||
|
|
||||||
|
|
||||||
def jabber(parser, xml_parent, data):
|
def jabber(registry, xml_parent, data):
|
||||||
"""yaml: jabber
|
"""yaml: jabber
|
||||||
Integrates Jenkins with the Jabber/XMPP instant messaging protocol
|
Integrates Jenkins with the Jabber/XMPP instant messaging protocol
|
||||||
Requires the Jenkins :jenkins-wiki:`Jabber Plugin <Jabber+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Jabber Plugin <Jabber+Plugin>`.
|
||||||
@ -2682,7 +2682,7 @@ def jabber(parser, xml_parent, data):
|
|||||||
XML.SubElement(j, 'matrixMultiplier').text = 'ONLY_CONFIGURATIONS'
|
XML.SubElement(j, 'matrixMultiplier').text = 'ONLY_CONFIGURATIONS'
|
||||||
|
|
||||||
|
|
||||||
def workspace_cleanup(parser, xml_parent, data):
|
def workspace_cleanup(registry, xml_parent, data):
|
||||||
"""yaml: workspace-cleanup (post-build)
|
"""yaml: workspace-cleanup (post-build)
|
||||||
|
|
||||||
Requires the Jenkins :jenkins-wiki:`Workspace Cleanup Plugin
|
Requires the Jenkins :jenkins-wiki:`Workspace Cleanup Plugin
|
||||||
@ -2757,7 +2757,7 @@ def workspace_cleanup(parser, xml_parent, data):
|
|||||||
XML.SubElement(p, 'notFailBuild').text = 'false'
|
XML.SubElement(p, 'notFailBuild').text = 'false'
|
||||||
|
|
||||||
|
|
||||||
def maven_deploy(parser, xml_parent, data):
|
def maven_deploy(registry, xml_parent, data):
|
||||||
"""yaml: maven-deploy
|
"""yaml: maven-deploy
|
||||||
Deploy artifacts to Maven repository.
|
Deploy artifacts to Maven repository.
|
||||||
|
|
||||||
@ -2790,7 +2790,7 @@ def maven_deploy(parser, xml_parent, data):
|
|||||||
XML.SubElement(p, 'releaseEnvVar').text = data['release-env-var']
|
XML.SubElement(p, 'releaseEnvVar').text = data['release-env-var']
|
||||||
|
|
||||||
|
|
||||||
def artifactory(parser, xml_parent, data):
|
def artifactory(registry, xml_parent, data):
|
||||||
"""yaml: artifactory
|
"""yaml: artifactory
|
||||||
Uses/requires the Artifactory plugin to deploy artifacts to
|
Uses/requires the Artifactory plugin to deploy artifacts to
|
||||||
Artifactory Server.
|
Artifactory Server.
|
||||||
@ -2928,7 +2928,7 @@ def artifactory(parser, xml_parent, data):
|
|||||||
helpers.artifactory_env_vars_patterns(artifactory, data)
|
helpers.artifactory_env_vars_patterns(artifactory, data)
|
||||||
|
|
||||||
|
|
||||||
def test_fairy(parser, xml_parent, data):
|
def test_fairy(registry, xml_parent, data):
|
||||||
"""yaml: test-fairy
|
"""yaml: test-fairy
|
||||||
This plugin helps you to upload Android APKs or iOS IPA files to
|
This plugin helps you to upload Android APKs or iOS IPA files to
|
||||||
www.testfairy.com.
|
www.testfairy.com.
|
||||||
@ -3030,7 +3030,7 @@ def test_fairy(parser, xml_parent, data):
|
|||||||
raise InvalidAttributeError('platform', platform, valid_platforms)
|
raise InvalidAttributeError('platform', platform, valid_platforms)
|
||||||
|
|
||||||
|
|
||||||
def text_finder(parser, xml_parent, data):
|
def text_finder(registry, xml_parent, data):
|
||||||
"""yaml: text-finder
|
"""yaml: text-finder
|
||||||
This plugin lets you search keywords in the files you specified and
|
This plugin lets you search keywords in the files you specified and
|
||||||
additionally check build status
|
additionally check build status
|
||||||
@ -3067,7 +3067,7 @@ def text_finder(parser, xml_parent, data):
|
|||||||
XML.SubElement(finder, 'unstableIfFound').text = unstable_if_found
|
XML.SubElement(finder, 'unstableIfFound').text = unstable_if_found
|
||||||
|
|
||||||
|
|
||||||
def html_publisher(parser, xml_parent, data):
|
def html_publisher(registry, xml_parent, data):
|
||||||
"""yaml: html-publisher
|
"""yaml: html-publisher
|
||||||
This plugin publishes HTML reports.
|
This plugin publishes HTML reports.
|
||||||
|
|
||||||
@ -3106,7 +3106,7 @@ def html_publisher(parser, xml_parent, data):
|
|||||||
XML.SubElement(ptarget, 'wrapperName').text = "htmlpublisher-wrapper.html"
|
XML.SubElement(ptarget, 'wrapperName').text = "htmlpublisher-wrapper.html"
|
||||||
|
|
||||||
|
|
||||||
def rich_text_publisher(parser, xml_parent, data):
|
def rich_text_publisher(registry, xml_parent, data):
|
||||||
"""yaml: rich-text-publisher
|
"""yaml: rich-text-publisher
|
||||||
This plugin puts custom rich text message to the Build pages and Job main
|
This plugin puts custom rich text message to the Build pages and Job main
|
||||||
page.
|
page.
|
||||||
@ -3148,7 +3148,7 @@ def rich_text_publisher(parser, xml_parent, data):
|
|||||||
XML.SubElement(reporter, 'parserName').text = parser_name
|
XML.SubElement(reporter, 'parserName').text = parser_name
|
||||||
|
|
||||||
|
|
||||||
def tap(parser, xml_parent, data):
|
def tap(registry, xml_parent, data):
|
||||||
"""yaml: tap
|
"""yaml: tap
|
||||||
Adds support to TAP test result files
|
Adds support to TAP test result files
|
||||||
|
|
||||||
@ -3204,7 +3204,7 @@ def tap(parser, xml_parent, data):
|
|||||||
helpers.convert_mapping_to_xml(tap, data, mappings, fail_required=True)
|
helpers.convert_mapping_to_xml(tap, data, mappings, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def post_tasks(parser, xml_parent, data):
|
def post_tasks(registry, xml_parent, data):
|
||||||
"""yaml: post-tasks
|
"""yaml: post-tasks
|
||||||
Adds support to post build task plugin
|
Adds support to post build task plugin
|
||||||
|
|
||||||
@ -3257,7 +3257,7 @@ def post_tasks(parser, xml_parent, data):
|
|||||||
task.get('script', ''))
|
task.get('script', ''))
|
||||||
|
|
||||||
|
|
||||||
def postbuildscript(parser, xml_parent, data):
|
def postbuildscript(registry, xml_parent, data):
|
||||||
"""yaml: postbuildscript
|
"""yaml: postbuildscript
|
||||||
Executes additional builders, script or Groovy after the build is
|
Executes additional builders, script or Groovy after the build is
|
||||||
complete.
|
complete.
|
||||||
@ -3350,8 +3350,7 @@ def postbuildscript(parser, xml_parent, data):
|
|||||||
if step == 'builders':
|
if step == 'builders':
|
||||||
build_steps_xml = XML.SubElement(pbs_xml, 'buildSteps')
|
build_steps_xml = XML.SubElement(pbs_xml, 'buildSteps')
|
||||||
for builder in script_data:
|
for builder in script_data:
|
||||||
parser.registry.dispatch('builder', parser, build_steps_xml,
|
registry.dispatch('builder', build_steps_xml, builder)
|
||||||
builder)
|
|
||||||
|
|
||||||
# When to run the build? Note the plugin let one specify both options
|
# When to run the build? Note the plugin let one specify both options
|
||||||
# although they are antinomic
|
# although they are antinomic
|
||||||
@ -3390,7 +3389,7 @@ def postbuildscript(parser, xml_parent, data):
|
|||||||
execute_on_xml.text = execute_on.upper()
|
execute_on_xml.text = execute_on.upper()
|
||||||
|
|
||||||
|
|
||||||
def xml_summary(parser, xml_parent, data):
|
def xml_summary(registry, xml_parent, data):
|
||||||
"""yaml: xml-summary
|
"""yaml: xml-summary
|
||||||
Adds support for the Summary Display Plugin
|
Adds support for the Summary Display Plugin
|
||||||
|
|
||||||
@ -3415,7 +3414,7 @@ def xml_summary(parser, xml_parent, data):
|
|||||||
data.get('shown-on-project-page', 'false'))
|
data.get('shown-on-project-page', 'false'))
|
||||||
|
|
||||||
|
|
||||||
def robot(parser, xml_parent, data):
|
def robot(registry, xml_parent, data):
|
||||||
"""yaml: robot
|
"""yaml: robot
|
||||||
Adds support for the Robot Framework Plugin
|
Adds support for the Robot Framework Plugin
|
||||||
|
|
||||||
@ -3470,7 +3469,7 @@ def robot(parser, xml_parent, data):
|
|||||||
not data.get('archive-output-xml', True)).lower()
|
not data.get('archive-output-xml', True)).lower()
|
||||||
|
|
||||||
|
|
||||||
def warnings(parser, xml_parent, data):
|
def warnings(registry, xml_parent, data):
|
||||||
"""yaml: warnings
|
"""yaml: warnings
|
||||||
Generate trend report for compiler warnings in the console log or
|
Generate trend report for compiler warnings in the console log or
|
||||||
in log files. Requires the Jenkins :jenkins-wiki:`Warnings Plugin
|
in log files. Requires the Jenkins :jenkins-wiki:`Warnings Plugin
|
||||||
@ -3650,7 +3649,7 @@ def warnings(parser, xml_parent, data):
|
|||||||
XML.SubElement(warnings, 'defaultEncoding').text = encoding
|
XML.SubElement(warnings, 'defaultEncoding').text = encoding
|
||||||
|
|
||||||
|
|
||||||
def sloccount(parser, xml_parent, data):
|
def sloccount(registry, xml_parent, data):
|
||||||
"""yaml: sloccount
|
"""yaml: sloccount
|
||||||
Generates the trend report for SLOCCount
|
Generates the trend report for SLOCCount
|
||||||
|
|
||||||
@ -3678,7 +3677,7 @@ def sloccount(parser, xml_parent, data):
|
|||||||
XML.SubElement(top, 'encoding').text = data.get('charset', 'UTF-8')
|
XML.SubElement(top, 'encoding').text = data.get('charset', 'UTF-8')
|
||||||
|
|
||||||
|
|
||||||
def ircbot(parser, xml_parent, data):
|
def ircbot(registry, xml_parent, data):
|
||||||
"""yaml: ircbot
|
"""yaml: ircbot
|
||||||
ircbot enables Jenkins to send build notifications via IRC and lets you
|
ircbot enables Jenkins to send build notifications via IRC and lets you
|
||||||
interact with Jenkins via an IRC bot.
|
interact with Jenkins via an IRC bot.
|
||||||
@ -3795,7 +3794,7 @@ def ircbot(parser, xml_parent, data):
|
|||||||
XML.SubElement(top, 'matrixMultiplier').text = matrix_dict.get(matrix)
|
XML.SubElement(top, 'matrixMultiplier').text = matrix_dict.get(matrix)
|
||||||
|
|
||||||
|
|
||||||
def plot(parser, xml_parent, data):
|
def plot(registry, xml_parent, data):
|
||||||
"""yaml: plot
|
"""yaml: plot
|
||||||
Plot provides generic plotting (or graphing).
|
Plot provides generic plotting (or graphing).
|
||||||
|
|
||||||
@ -3946,7 +3945,7 @@ def plot(parser, xml_parent, data):
|
|||||||
XML.SubElement(plugin, 'style').text = style
|
XML.SubElement(plugin, 'style').text = style
|
||||||
|
|
||||||
|
|
||||||
def git(parser, xml_parent, data):
|
def git(registry, xml_parent, data):
|
||||||
"""yaml: git
|
"""yaml: git
|
||||||
This plugin will configure the Jenkins Git plugin to
|
This plugin will configure the Jenkins Git plugin to
|
||||||
push merge results, tags, and/or branches to
|
push merge results, tags, and/or branches to
|
||||||
@ -4049,7 +4048,7 @@ def git(parser, xml_parent, data):
|
|||||||
xml_note, note['note'], note_mappings, fail_required=True)
|
xml_note, note['note'], note_mappings, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def github_notifier(parser, xml_parent, data):
|
def github_notifier(registry, xml_parent, data):
|
||||||
"""yaml: github-notifier
|
"""yaml: github-notifier
|
||||||
Set build status on Github commit.
|
Set build status on Github commit.
|
||||||
Requires the Jenkins :jenkins-wiki:`Github Plugin <GitHub+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Github Plugin <GitHub+Plugin>`.
|
||||||
@ -4063,7 +4062,7 @@ def github_notifier(parser, xml_parent, data):
|
|||||||
'com.cloudbees.jenkins.GitHubCommitNotifier')
|
'com.cloudbees.jenkins.GitHubCommitNotifier')
|
||||||
|
|
||||||
|
|
||||||
def gitlab_notifier(parser, xml_parent, data):
|
def gitlab_notifier(registry, xml_parent, data):
|
||||||
"""yaml: gitlab-notifier
|
"""yaml: gitlab-notifier
|
||||||
Set build status on GitLab commit.
|
Set build status on GitLab commit.
|
||||||
Requires the Jenkins :jenkins-wiki:`GitLab Plugin <GitLab+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`GitLab Plugin <GitLab+Plugin>`.
|
||||||
@ -4078,7 +4077,7 @@ def gitlab_notifier(parser, xml_parent, data):
|
|||||||
'com.dabsquared.gitlabjenkins.publisher.GitLabCommitStatusPublisher')
|
'com.dabsquared.gitlabjenkins.publisher.GitLabCommitStatusPublisher')
|
||||||
|
|
||||||
|
|
||||||
def zulip(parser, xml_parent, data):
|
def zulip(registry, xml_parent, data):
|
||||||
"""yaml: zulip
|
"""yaml: zulip
|
||||||
Set build status on zulip.
|
Set build status on zulip.
|
||||||
Requires the Jenkins :jenkins-wiki:`Humbug Plugin <Humbug+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Humbug Plugin <Humbug+Plugin>`.
|
||||||
@ -4092,7 +4091,7 @@ def zulip(parser, xml_parent, data):
|
|||||||
'hudson.plugins.humbug.HumbugNotifier')
|
'hudson.plugins.humbug.HumbugNotifier')
|
||||||
|
|
||||||
|
|
||||||
def build_publisher(parser, xml_parent, data):
|
def build_publisher(registry, xml_parent, data):
|
||||||
"""yaml: build-publisher
|
"""yaml: build-publisher
|
||||||
This plugin allows records from one Jenkins to be published
|
This plugin allows records from one Jenkins to be published
|
||||||
on another Jenkins.
|
on another Jenkins.
|
||||||
@ -4134,7 +4133,7 @@ def build_publisher(parser, xml_parent, data):
|
|||||||
XML.SubElement(logrotator, 'artifactNumToKeep').text = "-1"
|
XML.SubElement(logrotator, 'artifactNumToKeep').text = "-1"
|
||||||
|
|
||||||
|
|
||||||
def stash(parser, xml_parent, data):
|
def stash(registry, xml_parent, data):
|
||||||
"""yaml: stash
|
"""yaml: stash
|
||||||
This plugin will configure the Jenkins Stash Notifier plugin to
|
This plugin will configure the Jenkins Stash Notifier plugin to
|
||||||
notify Atlassian Stash after job completes.
|
notify Atlassian Stash after job completes.
|
||||||
@ -4166,10 +4165,10 @@ def stash(parser, xml_parent, data):
|
|||||||
else:
|
else:
|
||||||
XML.SubElement(top, 'stashUserName'
|
XML.SubElement(top, 'stashUserName'
|
||||||
).text = helpers.get_value_from_yaml_or_config_file(
|
).text = helpers.get_value_from_yaml_or_config_file(
|
||||||
'username', 'stash', data, parser)
|
'username', 'stash', data, registry.jjb_config)
|
||||||
XML.SubElement(top, 'stashUserPassword'
|
XML.SubElement(top, 'stashUserPassword'
|
||||||
).text = helpers.get_value_from_yaml_or_config_file(
|
).text = helpers.get_value_from_yaml_or_config_file(
|
||||||
'password', 'stash', data, parser)
|
'password', 'stash', data, registry.jjb_config)
|
||||||
|
|
||||||
XML.SubElement(top, 'ignoreUnverifiedSSLPeer').text = str(
|
XML.SubElement(top, 'ignoreUnverifiedSSLPeer').text = str(
|
||||||
data.get('ignore-ssl', False)).lower()
|
data.get('ignore-ssl', False)).lower()
|
||||||
@ -4178,7 +4177,7 @@ def stash(parser, xml_parent, data):
|
|||||||
data.get('include-build-number', False)).lower()
|
data.get('include-build-number', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def dependency_check(parser, xml_parent, data):
|
def dependency_check(registry, xml_parent, data):
|
||||||
"""yaml: dependency-check
|
"""yaml: dependency-check
|
||||||
Dependency-Check is an open source utility that identifies project
|
Dependency-Check is an open source utility that identifies project
|
||||||
dependencies and checks if there are any known, publicly disclosed,
|
dependencies and checks if there are any known, publicly disclosed,
|
||||||
@ -4249,7 +4248,7 @@ def dependency_check(parser, xml_parent, data):
|
|||||||
'[DEPENDENCYCHECK] ', dependency_check, data)
|
'[DEPENDENCYCHECK] ', dependency_check, data)
|
||||||
|
|
||||||
|
|
||||||
def description_setter(parser, xml_parent, data):
|
def description_setter(registry, xml_parent, data):
|
||||||
"""yaml: description-setter
|
"""yaml: description-setter
|
||||||
This plugin sets the description for each build,
|
This plugin sets the description for each build,
|
||||||
based upon a RegEx test of the build log file.
|
based upon a RegEx test of the build log file.
|
||||||
@ -4289,7 +4288,7 @@ def description_setter(parser, xml_parent, data):
|
|||||||
XML.SubElement(descriptionsetter, 'setForMatrix').text = for_matrix
|
XML.SubElement(descriptionsetter, 'setForMatrix').text = for_matrix
|
||||||
|
|
||||||
|
|
||||||
def doxygen(parser, xml_parent, data):
|
def doxygen(registry, xml_parent, data):
|
||||||
"""yaml: doxygen
|
"""yaml: doxygen
|
||||||
This plugin parses the Doxygen descriptor (Doxyfile) and provides a link to
|
This plugin parses the Doxygen descriptor (Doxyfile) and provides a link to
|
||||||
the generated Doxygen documentation.
|
the generated Doxygen documentation.
|
||||||
@ -4332,7 +4331,7 @@ def doxygen(parser, xml_parent, data):
|
|||||||
data.get('folder', ''))
|
data.get('folder', ''))
|
||||||
|
|
||||||
|
|
||||||
def sitemonitor(parser, xml_parent, data):
|
def sitemonitor(registry, xml_parent, data):
|
||||||
"""yaml: sitemonitor
|
"""yaml: sitemonitor
|
||||||
This plugin checks the availability of an url.
|
This plugin checks the availability of an url.
|
||||||
|
|
||||||
@ -4355,7 +4354,7 @@ def sitemonitor(parser, xml_parent, data):
|
|||||||
XML.SubElement(site, 'mUrl').text = siteurl['url']
|
XML.SubElement(site, 'mUrl').text = siteurl['url']
|
||||||
|
|
||||||
|
|
||||||
def testng(parser, xml_parent, data):
|
def testng(registry, xml_parent, data):
|
||||||
"""yaml: testng
|
"""yaml: testng
|
||||||
This plugin publishes TestNG test reports.
|
This plugin publishes TestNG test reports.
|
||||||
|
|
||||||
@ -4423,7 +4422,7 @@ def testng(parser, xml_parent, data):
|
|||||||
'threshold-mode', threshold_mode, valid_threshold_modes)
|
'threshold-mode', threshold_mode, valid_threshold_modes)
|
||||||
|
|
||||||
|
|
||||||
def artifact_deployer(parser, xml_parent, data):
|
def artifact_deployer(registry, xml_parent, data):
|
||||||
"""yaml: artifact-deployer
|
"""yaml: artifact-deployer
|
||||||
This plugin makes it possible to copy artifacts to remote locations.
|
This plugin makes it possible to copy artifacts to remote locations.
|
||||||
|
|
||||||
@ -4489,7 +4488,7 @@ def artifact_deployer(parser, xml_parent, data):
|
|||||||
XML.SubElement(deployer, 'deployEvenBuildFail').text = deploy_if_fail
|
XML.SubElement(deployer, 'deployEvenBuildFail').text = deploy_if_fail
|
||||||
|
|
||||||
|
|
||||||
def s3(parser, xml_parent, data):
|
def s3(registry, xml_parent, data):
|
||||||
"""yaml: s3
|
"""yaml: s3
|
||||||
Upload build artifacts to Amazon S3.
|
Upload build artifacts to Amazon S3.
|
||||||
|
|
||||||
@ -4568,7 +4567,7 @@ def s3(parser, xml_parent, data):
|
|||||||
XML.SubElement(pair, 'value').text = tag.get('value')
|
XML.SubElement(pair, 'value').text = tag.get('value')
|
||||||
|
|
||||||
|
|
||||||
def ruby_metrics(parser, xml_parent, data):
|
def ruby_metrics(registry, xml_parent, data):
|
||||||
"""yaml: ruby-metrics
|
"""yaml: ruby-metrics
|
||||||
Rcov plugin parses rcov html report files and
|
Rcov plugin parses rcov html report files and
|
||||||
shows it in Jenkins with a trend graph.
|
shows it in Jenkins with a trend graph.
|
||||||
@ -4616,7 +4615,7 @@ def ruby_metrics(parser, xml_parent, data):
|
|||||||
raise JenkinsJobsException('Coverage metric targets must be set')
|
raise JenkinsJobsException('Coverage metric targets must be set')
|
||||||
|
|
||||||
|
|
||||||
def fitnesse(parser, xml_parent, data):
|
def fitnesse(registry, xml_parent, data):
|
||||||
"""yaml: fitnesse
|
"""yaml: fitnesse
|
||||||
Publish Fitnesse test results
|
Publish Fitnesse test results
|
||||||
|
|
||||||
@ -4636,7 +4635,7 @@ def fitnesse(parser, xml_parent, data):
|
|||||||
XML.SubElement(fitnesse, 'fitnessePathToXmlResultsIn').text = results
|
XML.SubElement(fitnesse, 'fitnessePathToXmlResultsIn').text = results
|
||||||
|
|
||||||
|
|
||||||
def valgrind(parser, xml_parent, data):
|
def valgrind(registry, xml_parent, data):
|
||||||
"""yaml: valgrind
|
"""yaml: valgrind
|
||||||
This plugin publishes Valgrind Memcheck XML results.
|
This plugin publishes Valgrind Memcheck XML results.
|
||||||
|
|
||||||
@ -4701,7 +4700,7 @@ def valgrind(parser, xml_parent, data):
|
|||||||
data.get('publish-if-failed', False)).lower()
|
data.get('publish-if-failed', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def pmd(parser, xml_parent, data):
|
def pmd(registry, xml_parent, data):
|
||||||
"""yaml: pmd
|
"""yaml: pmd
|
||||||
Publish trend reports with PMD.
|
Publish trend reports with PMD.
|
||||||
Requires the Jenkins :jenkins-wiki:`PMD Plugin <PMD+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`PMD Plugin <PMD+Plugin>`.
|
||||||
@ -4770,7 +4769,7 @@ def pmd(parser, xml_parent, data):
|
|||||||
helpers.build_trends_publisher('[PMD] ', xml_element, data)
|
helpers.build_trends_publisher('[PMD] ', xml_element, data)
|
||||||
|
|
||||||
|
|
||||||
def scan_build(parser, xml_parent, data):
|
def scan_build(registry, xml_parent, data):
|
||||||
"""yaml: scan-build
|
"""yaml: scan-build
|
||||||
Publishes results from the Clang scan-build static analyzer.
|
Publishes results from the Clang scan-build static analyzer.
|
||||||
|
|
||||||
@ -4813,7 +4812,7 @@ def scan_build(parser, xml_parent, data):
|
|||||||
helpers.convert_mapping_to_xml(p, data, mappings, fail_required=True)
|
helpers.convert_mapping_to_xml(p, data, mappings, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def dry(parser, xml_parent, data):
|
def dry(registry, xml_parent, data):
|
||||||
"""yaml: dry
|
"""yaml: dry
|
||||||
Publish trend reports with DRY.
|
Publish trend reports with DRY.
|
||||||
Requires the Jenkins :jenkins-wiki:`DRY Plugin <DRY+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`DRY Plugin <DRY+Plugin>`.
|
||||||
@ -4892,7 +4891,7 @@ def dry(parser, xml_parent, data):
|
|||||||
xml_element, data, settings, fail_required=True)
|
xml_element, data, settings, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def shining_panda(parser, xml_parent, data):
|
def shining_panda(registry, xml_parent, data):
|
||||||
"""yaml: shining-panda
|
"""yaml: shining-panda
|
||||||
Publish coverage.py results. Requires the Jenkins
|
Publish coverage.py results. Requires the Jenkins
|
||||||
:jenkins-wiki:`ShiningPanda Plugin <ShiningPanda+Plugin>`.
|
:jenkins-wiki:`ShiningPanda Plugin <ShiningPanda+Plugin>`.
|
||||||
@ -4913,7 +4912,7 @@ def shining_panda(parser, xml_parent, data):
|
|||||||
data['html-reports-directory'])
|
data['html-reports-directory'])
|
||||||
|
|
||||||
|
|
||||||
def downstream_ext(parser, xml_parent, data):
|
def downstream_ext(registry, xml_parent, data):
|
||||||
"""yaml: downstream-ext
|
"""yaml: downstream-ext
|
||||||
Trigger multiple downstream jobs when a job is completed and
|
Trigger multiple downstream jobs when a job is completed and
|
||||||
condition is met.
|
condition is met.
|
||||||
@ -4983,7 +4982,7 @@ def downstream_ext(parser, xml_parent, data):
|
|||||||
data.get('only-on-local-scm-change', False)).lower()
|
data.get('only-on-local-scm-change', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def rundeck(parser, xml_parent, data):
|
def rundeck(registry, xml_parent, data):
|
||||||
"""yaml: rundeck
|
"""yaml: rundeck
|
||||||
Trigger a rundeck job when the build is complete.
|
Trigger a rundeck job when the build is complete.
|
||||||
|
|
||||||
@ -5034,13 +5033,13 @@ def rundeck(parser, xml_parent, data):
|
|||||||
helpers.convert_mapping_to_xml(p, data, mappings, fail_required=True)
|
helpers.convert_mapping_to_xml(p, data, mappings, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def create_publishers(parser, action):
|
def create_publishers(registry, action):
|
||||||
dummy_parent = XML.Element("dummy")
|
dummy_parent = XML.Element("dummy")
|
||||||
parser.registry.dispatch('publisher', parser, dummy_parent, action)
|
registry.dispatch('publisher', dummy_parent, action)
|
||||||
return list(dummy_parent)
|
return list(dummy_parent)
|
||||||
|
|
||||||
|
|
||||||
def conditional_publisher(parser, xml_parent, data):
|
def conditional_publisher(registry, xml_parent, data):
|
||||||
"""yaml: conditional-publisher
|
"""yaml: conditional-publisher
|
||||||
Conditionally execute some post-build steps. Requires the Jenkins
|
Conditionally execute some post-build steps. Requires the Jenkins
|
||||||
:jenkins-wiki:`Flexible Publish Plugin <Flexible+Publish+Plugin>`.
|
:jenkins-wiki:`Flexible Publish Plugin <Flexible+Publish+Plugin>`.
|
||||||
@ -5195,7 +5194,7 @@ def conditional_publisher(parser, xml_parent, data):
|
|||||||
'value.' % kind)
|
'value.' % kind)
|
||||||
|
|
||||||
def publish_action(parent, action):
|
def publish_action(parent, action):
|
||||||
for edited_node in create_publishers(parser, action):
|
for edited_node in create_publishers(registry, action):
|
||||||
if not use_publisher_list:
|
if not use_publisher_list:
|
||||||
edited_node.set('class', edited_node.tag)
|
edited_node.set('class', edited_node.tag)
|
||||||
edited_node.tag = 'publisher'
|
edited_node.tag = 'publisher'
|
||||||
@ -5240,7 +5239,7 @@ def conditional_publisher(parser, xml_parent, data):
|
|||||||
action_parent = cond_publisher
|
action_parent = cond_publisher
|
||||||
|
|
||||||
plugin_info = \
|
plugin_info = \
|
||||||
parser.registry.get_plugin_info("Flexible Publish Plugin")
|
registry.get_plugin_info("Flexible Publish Plugin")
|
||||||
version = pkg_resources.parse_version(plugin_info.get('version',
|
version = pkg_resources.parse_version(plugin_info.get('version',
|
||||||
'0'))
|
'0'))
|
||||||
# XML tag changed from publisher to publisherList in v0.13
|
# XML tag changed from publisher to publisherList in v0.13
|
||||||
@ -5262,7 +5261,7 @@ def conditional_publisher(parser, xml_parent, data):
|
|||||||
raise JenkinsJobsException('action must be set for each condition')
|
raise JenkinsJobsException('action must be set for each condition')
|
||||||
|
|
||||||
|
|
||||||
def scoverage(parser, xml_parent, data):
|
def scoverage(registry, xml_parent, data):
|
||||||
"""yaml: scoverage
|
"""yaml: scoverage
|
||||||
Publish scoverage results as a trend graph.
|
Publish scoverage results as a trend graph.
|
||||||
Requires the Jenkins :jenkins-wiki:`Scoverage Plugin <Scoverage+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Scoverage Plugin <Scoverage+Plugin>`.
|
||||||
@ -5290,7 +5289,7 @@ def scoverage(parser, xml_parent, data):
|
|||||||
scoverage, data, mappings, fail_required=True)
|
scoverage, data, mappings, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def display_upstream_changes(parser, xml_parent, data):
|
def display_upstream_changes(registry, xml_parent, data):
|
||||||
"""yaml: display-upstream-changes
|
"""yaml: display-upstream-changes
|
||||||
Display SCM changes of upstream jobs. Requires the Jenkins
|
Display SCM changes of upstream jobs. Requires the Jenkins
|
||||||
:jenkins-wiki:`Display Upstream Changes Plugin
|
:jenkins-wiki:`Display Upstream Changes Plugin
|
||||||
@ -5307,7 +5306,7 @@ def display_upstream_changes(parser, xml_parent, data):
|
|||||||
'DisplayUpstreamChangesRecorder')
|
'DisplayUpstreamChangesRecorder')
|
||||||
|
|
||||||
|
|
||||||
def gatling(parser, xml_parent, data):
|
def gatling(registry, xml_parent, data):
|
||||||
"""yaml: gatling
|
"""yaml: gatling
|
||||||
Publish gatling results as a trend graph
|
Publish gatling results as a trend graph
|
||||||
Requires the Jenkins :jenkins-wiki:`Gatling Plugin <Gatling+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Gatling Plugin <Gatling+Plugin>`.
|
||||||
@ -5323,7 +5322,7 @@ def gatling(parser, xml_parent, data):
|
|||||||
XML.SubElement(gatling, 'enabled').text = 'true'
|
XML.SubElement(gatling, 'enabled').text = 'true'
|
||||||
|
|
||||||
|
|
||||||
def logstash(parser, xml_parent, data):
|
def logstash(registry, xml_parent, data):
|
||||||
"""yaml: logstash
|
"""yaml: logstash
|
||||||
Send job's console log to Logstash for processing and analyis of
|
Send job's console log to Logstash for processing and analyis of
|
||||||
your job data. Also stores test metrics from Junit.
|
your job data. Also stores test metrics from Junit.
|
||||||
@ -5356,7 +5355,7 @@ def logstash(parser, xml_parent, data):
|
|||||||
helpers.convert_mapping_to_xml(logstash, data, mapping, fail_required=True)
|
helpers.convert_mapping_to_xml(logstash, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def image_gallery(parser, xml_parent, data):
|
def image_gallery(registry, xml_parent, data):
|
||||||
"""yaml: image-gallery
|
"""yaml: image-gallery
|
||||||
Produce an image gallery using Javascript library. Requires the Jenkins
|
Produce an image gallery using Javascript library. Requires the Jenkins
|
||||||
:jenkins-wiki:`Image Gallery Plugin<Image+Gallery+Plugin>`.
|
:jenkins-wiki:`Image Gallery Plugin<Image+Gallery+Plugin>`.
|
||||||
@ -5430,7 +5429,7 @@ def image_gallery(parser, xml_parent, data):
|
|||||||
include_comparative_elements(gallery_config, gallery_def)
|
include_comparative_elements(gallery_config, gallery_def)
|
||||||
|
|
||||||
|
|
||||||
def naginator(parser, xml_parent, data):
|
def naginator(registry, xml_parent, data):
|
||||||
"""yaml: naginator
|
"""yaml: naginator
|
||||||
Automatically reschedule a build after a build failure
|
Automatically reschedule a build after a build failure
|
||||||
Requires the Jenkins :jenkins-wiki:`Naginator Plugin <Naginator+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Naginator Plugin <Naginator+Plugin>`.
|
||||||
@ -5494,7 +5493,7 @@ def naginator(parser, xml_parent, data):
|
|||||||
data.get('max-failed-builds', '0'))
|
data.get('max-failed-builds', '0'))
|
||||||
|
|
||||||
|
|
||||||
def disable_failed_job(parser, xml_parent, data):
|
def disable_failed_job(registry, xml_parent, data):
|
||||||
"""yaml: disable-failed-job
|
"""yaml: disable-failed-job
|
||||||
Automatically disable failed jobs.
|
Automatically disable failed jobs.
|
||||||
|
|
||||||
@ -5544,7 +5543,7 @@ def disable_failed_job(parser, xml_parent, data):
|
|||||||
XML.SubElement(xml_element, 'optionalBrockChecked').text = 'false'
|
XML.SubElement(xml_element, 'optionalBrockChecked').text = 'false'
|
||||||
|
|
||||||
|
|
||||||
def google_cloud_storage(parser, xml_parent, data):
|
def google_cloud_storage(registry, xml_parent, data):
|
||||||
"""yaml: google-cloud-storage
|
"""yaml: google-cloud-storage
|
||||||
Upload build artifacts to Google Cloud Storage. Requires the
|
Upload build artifacts to Google Cloud Storage. Requires the
|
||||||
Jenkins :jenkins-wiki:`Google Cloud Storage plugin
|
Jenkins :jenkins-wiki:`Google Cloud Storage plugin
|
||||||
@ -5742,7 +5741,7 @@ def google_cloud_storage(parser, xml_parent, data):
|
|||||||
properties, upload_element, types)
|
properties, upload_element, types)
|
||||||
|
|
||||||
|
|
||||||
def flowdock(parser, xml_parent, data):
|
def flowdock(registry, xml_parent, data):
|
||||||
"""yaml: flowdock
|
"""yaml: flowdock
|
||||||
This plugin publishes job build results to a Flowdock flow.
|
This plugin publishes job build results to a Flowdock flow.
|
||||||
|
|
||||||
@ -5820,7 +5819,7 @@ def flowdock(parser, xml_parent, data):
|
|||||||
gen_setting('NotBuilt', False)
|
gen_setting('NotBuilt', False)
|
||||||
|
|
||||||
|
|
||||||
def clamav(parser, xml_parent, data):
|
def clamav(registry, xml_parent, data):
|
||||||
"""yaml: clamav
|
"""yaml: clamav
|
||||||
Check files with ClamAV, an open source antivirus engine.
|
Check files with ClamAV, an open source antivirus engine.
|
||||||
Requires the Jenkins :jenkins-wiki:`ClamAV Plugin <ClamAV+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`ClamAV Plugin <ClamAV+Plugin>`.
|
||||||
@ -5852,7 +5851,7 @@ def clamav(parser, xml_parent, data):
|
|||||||
helpers.convert_mapping_to_xml(clamav, data, mappings, fail_required=True)
|
helpers.convert_mapping_to_xml(clamav, data, mappings, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def testselector(parser, xml_parent, data):
|
def testselector(registry, xml_parent, data):
|
||||||
"""yaml: testselector
|
"""yaml: testselector
|
||||||
This plugin allows you to choose specific tests you want to run.
|
This plugin allows you to choose specific tests you want to run.
|
||||||
|
|
||||||
@ -5908,7 +5907,7 @@ def testselector(parser, xml_parent, data):
|
|||||||
'multiplicity-field', '')
|
'multiplicity-field', '')
|
||||||
|
|
||||||
|
|
||||||
def cloudformation(parser, xml_parent, data):
|
def cloudformation(registry, xml_parent, data):
|
||||||
"""yaml: cloudformation
|
"""yaml: cloudformation
|
||||||
Create cloudformation stacks before running a build and optionally
|
Create cloudformation stacks before running a build and optionally
|
||||||
delete them at the end. Requires the Jenkins :jenkins-wiki:`AWS
|
delete them at the end. Requires the Jenkins :jenkins-wiki:`AWS
|
||||||
@ -5983,7 +5982,7 @@ def cloudformation(parser, xml_parent, data):
|
|||||||
region_dict)
|
region_dict)
|
||||||
|
|
||||||
|
|
||||||
def whitesource(parser, xml_parent, data):
|
def whitesource(registry, xml_parent, data):
|
||||||
"""yaml: whitesource
|
"""yaml: whitesource
|
||||||
This plugin brings automatic open source management to Jenkins users.
|
This plugin brings automatic open source management to Jenkins users.
|
||||||
|
|
||||||
@ -6037,7 +6036,7 @@ def whitesource(parser, xml_parent, data):
|
|||||||
XML.SubElement(whitesource, 'ignorePomModules').text = 'false'
|
XML.SubElement(whitesource, 'ignorePomModules').text = 'false'
|
||||||
|
|
||||||
|
|
||||||
def hipchat(parser, xml_parent, data):
|
def hipchat(registry, xml_parent, data):
|
||||||
"""yaml: hipchat
|
"""yaml: hipchat
|
||||||
Publisher that sends hipchat notifications on job events
|
Publisher that sends hipchat notifications on job events
|
||||||
Requires the Jenkins :jenkins-wiki:`Hipchat Plugin
|
Requires the Jenkins :jenkins-wiki:`Hipchat Plugin
|
||||||
@ -6108,7 +6107,7 @@ def hipchat(parser, xml_parent, data):
|
|||||||
data['complete-message'])
|
data['complete-message'])
|
||||||
|
|
||||||
|
|
||||||
def slack(parser, xml_parent, data):
|
def slack(registry, xml_parent, data):
|
||||||
"""yaml: slack
|
"""yaml: slack
|
||||||
Publisher that sends slack notifications on job events.
|
Publisher that sends slack notifications on job events.
|
||||||
|
|
||||||
@ -6180,7 +6179,7 @@ def slack(parser, xml_parent, data):
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
plugin_info = parser.registry.get_plugin_info('Slack Notification Plugin')
|
plugin_info = registry.get_plugin_info('Slack Notification Plugin')
|
||||||
plugin_ver = pkg_resources.parse_version(plugin_info.get('version', "0"))
|
plugin_ver = pkg_resources.parse_version(plugin_info.get('version', "0"))
|
||||||
|
|
||||||
mapping = (
|
mapping = (
|
||||||
@ -6247,7 +6246,7 @@ def slack(parser, xml_parent, data):
|
|||||||
_add_xml(slack, xml_name, value)
|
_add_xml(slack, xml_name, value)
|
||||||
|
|
||||||
|
|
||||||
def phabricator(parser, xml_parent, data):
|
def phabricator(registry, xml_parent, data):
|
||||||
"""yaml: phabricator
|
"""yaml: phabricator
|
||||||
Integrate with `Phabricator <http://phabricator.org/>`_
|
Integrate with `Phabricator <http://phabricator.org/>`_
|
||||||
|
|
||||||
@ -6289,7 +6288,7 @@ def phabricator(parser, xml_parent, data):
|
|||||||
data.get('comment-with-console-link-on-failure')).lower()
|
data.get('comment-with-console-link-on-failure')).lower()
|
||||||
|
|
||||||
|
|
||||||
def openshift_build_canceller(parser, xml_parent, data):
|
def openshift_build_canceller(registry, xml_parent, data):
|
||||||
"""yaml: openshift-build-canceller
|
"""yaml: openshift-build-canceller
|
||||||
This action is intended to provide cleanup for a Jenkins job which failed
|
This action is intended to provide cleanup for a Jenkins job which failed
|
||||||
because a build is hung (instead of terminating with a failure code);
|
because a build is hung (instead of terminating with a failure code);
|
||||||
@ -6340,7 +6339,7 @@ def openshift_build_canceller(parser, xml_parent, data):
|
|||||||
helpers.convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
helpers.convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def openshift_deploy_canceller(parser, xml_parent, data):
|
def openshift_deploy_canceller(registry, xml_parent, data):
|
||||||
"""yaml: openshift-deploy-canceller
|
"""yaml: openshift-deploy-canceller
|
||||||
This action is intended to provide cleanup for any OpenShift deployments
|
This action is intended to provide cleanup for any OpenShift deployments
|
||||||
left running when the Job completes; this step will allow you to perform
|
left running when the Job completes; this step will allow you to perform
|
||||||
@ -6388,7 +6387,7 @@ def openshift_deploy_canceller(parser, xml_parent, data):
|
|||||||
helpers.convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
helpers.convert_mapping_to_xml(osb, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def github_pull_request_merge(parser, xml_parent, data):
|
def github_pull_request_merge(registry, xml_parent, data):
|
||||||
"""yaml: github-pull-request-merge
|
"""yaml: github-pull-request-merge
|
||||||
This action merges the pull request that triggered the build (see the
|
This action merges the pull request that triggered the build (see the
|
||||||
github pull request trigger)
|
github pull request trigger)
|
||||||
@ -6440,8 +6439,8 @@ class Publishers(jenkins_jobs.modules.base.Base):
|
|||||||
component_type = 'publisher'
|
component_type = 'publisher'
|
||||||
component_list_type = 'publishers'
|
component_list_type = 'publishers'
|
||||||
|
|
||||||
def gen_xml(self, parser, xml_parent, data):
|
def gen_xml(self, xml_parent, data):
|
||||||
publishers = XML.SubElement(xml_parent, 'publishers')
|
publishers = XML.SubElement(xml_parent, 'publishers')
|
||||||
|
|
||||||
for action in data.get('publishers', []):
|
for action in data.get('publishers', []):
|
||||||
self.registry.dispatch('publisher', parser, publishers, action)
|
self.registry.dispatch('publisher', publishers, action)
|
||||||
|
@ -39,7 +39,7 @@ from jenkins_jobs.modules.helpers import build_trends_publisher
|
|||||||
from jenkins_jobs.modules.helpers import findbugs_settings
|
from jenkins_jobs.modules.helpers import findbugs_settings
|
||||||
|
|
||||||
|
|
||||||
def email(parser, xml_parent, data):
|
def email(registry, xml_parent, data):
|
||||||
"""yaml: email
|
"""yaml: email
|
||||||
Email notifications on build failure.
|
Email notifications on build failure.
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ def email(parser, xml_parent, data):
|
|||||||
XML.SubElement(mailer, 'perModuleEmail').text = 'true'
|
XML.SubElement(mailer, 'perModuleEmail').text = 'true'
|
||||||
|
|
||||||
|
|
||||||
def findbugs(parser, xml_parent, data):
|
def findbugs(registry, xml_parent, data):
|
||||||
"""yaml: findbugs
|
"""yaml: findbugs
|
||||||
FindBugs reporting for builds
|
FindBugs reporting for builds
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ class Reporters(jenkins_jobs.modules.base.Base):
|
|||||||
component_type = 'reporter'
|
component_type = 'reporter'
|
||||||
component_list_type = 'reporters'
|
component_list_type = 'reporters'
|
||||||
|
|
||||||
def gen_xml(self, parser, xml_parent, data):
|
def gen_xml(self, xml_parent, data):
|
||||||
if 'reporters' not in data:
|
if 'reporters' not in data:
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -153,4 +153,4 @@ class Reporters(jenkins_jobs.modules.base.Base):
|
|||||||
reporters = XML.SubElement(xml_parent, 'reporters')
|
reporters = XML.SubElement(xml_parent, 'reporters')
|
||||||
|
|
||||||
for action in data.get('reporters', []):
|
for action in data.get('reporters', []):
|
||||||
self.registry.dispatch('reporter', parser, reporters, action)
|
self.registry.dispatch('reporter', reporters, action)
|
||||||
|
@ -46,7 +46,7 @@ import jenkins_jobs.modules.base
|
|||||||
from jenkins_jobs.modules.helpers import convert_mapping_to_xml
|
from jenkins_jobs.modules.helpers import convert_mapping_to_xml
|
||||||
|
|
||||||
|
|
||||||
def git(parser, xml_parent, data):
|
def git(registry, xml_parent, data):
|
||||||
"""yaml: git
|
"""yaml: git
|
||||||
Specifies the git SCM repository for this job.
|
Specifies the git SCM repository for this job.
|
||||||
Requires the Jenkins :jenkins-wiki:`Git Plugin <Git+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Git Plugin <Git+Plugin>`.
|
||||||
@ -476,7 +476,7 @@ def git(parser, xml_parent, data):
|
|||||||
data.get('repo-name', ''))
|
data.get('repo-name', ''))
|
||||||
|
|
||||||
|
|
||||||
def cvs(parser, xml_parent, data):
|
def cvs(registry, xml_parent, data):
|
||||||
"""yaml: cvs
|
"""yaml: cvs
|
||||||
Specifies the CVS SCM repository for this job.
|
Specifies the CVS SCM repository for this job.
|
||||||
Requires the Jenkins :jenkins-wiki:`CVS Plugin <CVS+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`CVS Plugin <CVS+Plugin>`.
|
||||||
@ -606,7 +606,7 @@ def cvs(parser, xml_parent, data):
|
|||||||
data.get(opt, val)).lower()
|
data.get(opt, val)).lower()
|
||||||
|
|
||||||
|
|
||||||
def repo(parser, xml_parent, data):
|
def repo(registry, xml_parent, data):
|
||||||
"""yaml: repo
|
"""yaml: repo
|
||||||
Specifies the repo SCM repository for this job.
|
Specifies the repo SCM repository for this job.
|
||||||
Requires the Jenkins :jenkins-wiki:`Repo Plugin <Repo+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Repo Plugin <Repo+Plugin>`.
|
||||||
@ -683,7 +683,7 @@ def repo(parser, xml_parent, data):
|
|||||||
XML.SubElement(ip, 'string').text = str(ignored_project)
|
XML.SubElement(ip, 'string').text = str(ignored_project)
|
||||||
|
|
||||||
|
|
||||||
def store(parser, xml_parent, data):
|
def store(registry, xml_parent, data):
|
||||||
"""yaml: store
|
"""yaml: store
|
||||||
Specifies the Visualworks Smalltalk Store repository for this job.
|
Specifies the Visualworks Smalltalk Store repository for this job.
|
||||||
Requires the Jenkins :jenkins-wiki:`Visualworks Smalltalk Store Plugin
|
Requires the Jenkins :jenkins-wiki:`Visualworks Smalltalk Store Plugin
|
||||||
@ -745,7 +745,7 @@ def store(parser, xml_parent, data):
|
|||||||
XML.SubElement(scm, 'generateParcelBuilderInputFile').text = 'false'
|
XML.SubElement(scm, 'generateParcelBuilderInputFile').text = 'false'
|
||||||
|
|
||||||
|
|
||||||
def svn(parser, xml_parent, data):
|
def svn(registry, xml_parent, data):
|
||||||
"""yaml: svn
|
"""yaml: svn
|
||||||
Specifies the svn SCM repository for this job.
|
Specifies the svn SCM repository for this job.
|
||||||
|
|
||||||
@ -872,7 +872,7 @@ def svn(parser, xml_parent, data):
|
|||||||
xe.text = str(val)
|
xe.text = str(val)
|
||||||
|
|
||||||
|
|
||||||
def tfs(parser, xml_parent, data):
|
def tfs(registry, xml_parent, data):
|
||||||
"""yaml: tfs
|
"""yaml: tfs
|
||||||
Specifies the Team Foundation Server repository for this job.
|
Specifies the Team Foundation Server repository for this job.
|
||||||
Requires the Jenkins :jenkins-wiki:`Team Foundation Server Plugin
|
Requires the Jenkins :jenkins-wiki:`Team Foundation Server Plugin
|
||||||
@ -970,7 +970,7 @@ def tfs(parser, xml_parent, data):
|
|||||||
'Browser'})
|
'Browser'})
|
||||||
|
|
||||||
|
|
||||||
def workspace(parser, xml_parent, data):
|
def workspace(registry, xml_parent, data):
|
||||||
"""yaml: workspace
|
"""yaml: workspace
|
||||||
Specifies the cloned workspace for this job to use as a SCM source.
|
Specifies the cloned workspace for this job to use as a SCM source.
|
||||||
Requires the Jenkins :jenkins-wiki:`Clone Workspace SCM Plugin
|
Requires the Jenkins :jenkins-wiki:`Clone Workspace SCM Plugin
|
||||||
@ -1110,7 +1110,7 @@ def hg(self, xml_parent, data):
|
|||||||
"with browser.")
|
"with browser.")
|
||||||
|
|
||||||
|
|
||||||
def openshift_img_streams(parser, xml_parent, data):
|
def openshift_img_streams(registry, xml_parent, data):
|
||||||
"""yaml: openshift-img-streams
|
"""yaml: openshift-img-streams
|
||||||
Rather than a Build step extension plugin, this is an extension of the
|
Rather than a Build step extension plugin, this is an extension of the
|
||||||
Jenkins SCM plugin, where this baked-in polling mechanism provided by
|
Jenkins SCM plugin, where this baked-in polling mechanism provided by
|
||||||
@ -1165,7 +1165,7 @@ def openshift_img_streams(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(scm, data, mapping, fail_required=True)
|
convert_mapping_to_xml(scm, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def bzr(parser, xml_parent, data):
|
def bzr(registry, xml_parent, data):
|
||||||
"""yaml: bzr
|
"""yaml: bzr
|
||||||
Specifies the bzr SCM repository for this job.
|
Specifies the bzr SCM repository for this job.
|
||||||
Requires the Jenkins :jenkins-wiki:`Bazaar Plugin <Bazaar+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Bazaar Plugin <Bazaar+Plugin>`.
|
||||||
@ -1224,7 +1224,7 @@ def bzr(parser, xml_parent, data):
|
|||||||
data['opengrok-root-module'])
|
data['opengrok-root-module'])
|
||||||
|
|
||||||
|
|
||||||
def url(parser, xml_parent, data):
|
def url(registry, xml_parent, data):
|
||||||
"""yaml: url
|
"""yaml: url
|
||||||
|
|
||||||
Watch for changes in, and download an artifact from a particular url.
|
Watch for changes in, and download an artifact from a particular url.
|
||||||
@ -1262,10 +1262,10 @@ class SCM(jenkins_jobs.modules.base.Base):
|
|||||||
component_type = 'scm'
|
component_type = 'scm'
|
||||||
component_list_type = 'scm'
|
component_list_type = 'scm'
|
||||||
|
|
||||||
def gen_xml(self, parser, xml_parent, data):
|
def gen_xml(self, xml_parent, data):
|
||||||
scms_parent = XML.Element('scms')
|
scms_parent = XML.Element('scms')
|
||||||
for scm in data.get('scm', []):
|
for scm in data.get('scm', []):
|
||||||
self.registry.dispatch('scm', parser, scms_parent, scm)
|
self.registry.dispatch('scm', scms_parent, scm)
|
||||||
scms_count = len(scms_parent)
|
scms_count = len(scms_parent)
|
||||||
if scms_count == 0:
|
if scms_count == 0:
|
||||||
XML.SubElement(xml_parent, 'scm', {'class': 'hudson.scm.NullSCM'})
|
XML.SubElement(xml_parent, 'scm', {'class': 'hudson.scm.NullSCM'})
|
||||||
|
@ -207,7 +207,7 @@ def build_gerrit_skip_votes(xml_parent, data):
|
|||||||
XML.SubElement(skip_vote_node, tag_name).text = 'false'
|
XML.SubElement(skip_vote_node, tag_name).text = 'false'
|
||||||
|
|
||||||
|
|
||||||
def gerrit(parser, xml_parent, data):
|
def gerrit(registry, xml_parent, data):
|
||||||
"""yaml: gerrit
|
"""yaml: gerrit
|
||||||
|
|
||||||
Trigger on a Gerrit event.
|
Trigger on a Gerrit event.
|
||||||
@ -614,7 +614,7 @@ def gerrit(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(gtrig, data, message_mappings, fail_required=True)
|
convert_mapping_to_xml(gtrig, data, message_mappings, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def pollscm(parser, xml_parent, data):
|
def pollscm(registry, xml_parent, data):
|
||||||
"""yaml: pollscm
|
"""yaml: pollscm
|
||||||
Poll the SCM to determine if there has been a change.
|
Poll the SCM to determine if there has been a change.
|
||||||
|
|
||||||
@ -671,7 +671,7 @@ def build_content_type(xml_parent, entries, namespace, collection_suffix,
|
|||||||
XML.SubElement(content_entry, element_name).text = entry
|
XML.SubElement(content_entry, element_name).text = entry
|
||||||
|
|
||||||
|
|
||||||
def pollurl(parser, xml_parent, data):
|
def pollurl(registry, xml_parent, data):
|
||||||
"""yaml: pollurl
|
"""yaml: pollurl
|
||||||
Trigger when the HTTP response from a URL changes.
|
Trigger when the HTTP response from a URL changes.
|
||||||
Requires the Jenkins :jenkins-wiki:`URLTrigger Plugin <URLTrigger+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`URLTrigger Plugin <URLTrigger+Plugin>`.
|
||||||
@ -773,7 +773,7 @@ def pollurl(parser, xml_parent, data):
|
|||||||
'ContentEntry', *content_type[0:3])
|
'ContentEntry', *content_type[0:3])
|
||||||
|
|
||||||
|
|
||||||
def timed(parser, xml_parent, data):
|
def timed(registry, xml_parent, data):
|
||||||
"""yaml: timed
|
"""yaml: timed
|
||||||
Trigger builds at certain times.
|
Trigger builds at certain times.
|
||||||
|
|
||||||
@ -788,7 +788,7 @@ def timed(parser, xml_parent, data):
|
|||||||
XML.SubElement(scmtrig, 'spec').text = data
|
XML.SubElement(scmtrig, 'spec').text = data
|
||||||
|
|
||||||
|
|
||||||
def bitbucket(parser, xml_parent, data):
|
def bitbucket(registry, xml_parent, data):
|
||||||
"""yaml: bitbucket
|
"""yaml: bitbucket
|
||||||
Trigger a job when bitbucket repository is pushed to.
|
Trigger a job when bitbucket repository is pushed to.
|
||||||
Requires the Jenkins :jenkins-wiki:`BitBucket Plugin
|
Requires the Jenkins :jenkins-wiki:`BitBucket Plugin
|
||||||
@ -803,7 +803,7 @@ def bitbucket(parser, xml_parent, data):
|
|||||||
XML.SubElement(bbtrig, 'spec').text = ''
|
XML.SubElement(bbtrig, 'spec').text = ''
|
||||||
|
|
||||||
|
|
||||||
def github(parser, xml_parent, data):
|
def github(registry, xml_parent, data):
|
||||||
"""yaml: github
|
"""yaml: github
|
||||||
Trigger a job when github repository is pushed to.
|
Trigger a job when github repository is pushed to.
|
||||||
Requires the Jenkins :jenkins-wiki:`GitHub Plugin <GitHub+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`GitHub Plugin <GitHub+Plugin>`.
|
||||||
@ -818,7 +818,7 @@ def github(parser, xml_parent, data):
|
|||||||
XML.SubElement(ghtrig, 'spec').text = ''
|
XML.SubElement(ghtrig, 'spec').text = ''
|
||||||
|
|
||||||
|
|
||||||
def github_pull_request(parser, xml_parent, data):
|
def github_pull_request(registry, xml_parent, data):
|
||||||
"""yaml: github-pull-request
|
"""yaml: github-pull-request
|
||||||
Build pull requests in github and report results.
|
Build pull requests in github and report results.
|
||||||
Requires the Jenkins :jenkins-wiki:`GitHub Pull Request Builder Plugin
|
Requires the Jenkins :jenkins-wiki:`GitHub Pull Request Builder Plugin
|
||||||
@ -1025,7 +1025,7 @@ def github_pull_request(parser, xml_parent, data):
|
|||||||
XML.SubElement(error_comment_elem, 'result').text = 'ERROR'
|
XML.SubElement(error_comment_elem, 'result').text = 'ERROR'
|
||||||
|
|
||||||
|
|
||||||
def gitlab_merge_request(parser, xml_parent, data):
|
def gitlab_merge_request(registry, xml_parent, data):
|
||||||
"""yaml: gitlab-merge-request
|
"""yaml: gitlab-merge-request
|
||||||
Build merge requests in gitlab and report results.
|
Build merge requests in gitlab and report results.
|
||||||
Requires the Jenkins :jenkins-wiki:`Gitlab MergeRequest Builder Plugin.
|
Requires the Jenkins :jenkins-wiki:`Gitlab MergeRequest Builder Plugin.
|
||||||
@ -1057,7 +1057,7 @@ def gitlab_merge_request(parser, xml_parent, data):
|
|||||||
XML.SubElement(ghprb, '__projectPath').text = data.get('project-path')
|
XML.SubElement(ghprb, '__projectPath').text = data.get('project-path')
|
||||||
|
|
||||||
|
|
||||||
def gitlab(parser, xml_parent, data):
|
def gitlab(registry, xml_parent, data):
|
||||||
"""yaml: gitlab
|
"""yaml: gitlab
|
||||||
Makes Jenkins act like a GitLab CI server.
|
Makes Jenkins act like a GitLab CI server.
|
||||||
Requires the Jenkins :jenkins-wiki:`GitLab Plugin
|
Requires the Jenkins :jenkins-wiki:`GitLab Plugin
|
||||||
@ -1148,7 +1148,7 @@ def gitlab(parser, xml_parent, data):
|
|||||||
gitlab = XML.SubElement(
|
gitlab = XML.SubElement(
|
||||||
xml_parent, 'com.dabsquared.gitlabjenkins.GitLabPushTrigger'
|
xml_parent, 'com.dabsquared.gitlabjenkins.GitLabPushTrigger'
|
||||||
)
|
)
|
||||||
plugin_info = parser.registry.get_plugin_info('GitLab Plugin')
|
plugin_info = registry.get_plugin_info('GitLab Plugin')
|
||||||
plugin_ver = pkg_resources.parse_version(plugin_info.get('version', "0"))
|
plugin_ver = pkg_resources.parse_version(plugin_info.get('version', "0"))
|
||||||
valid_merge_request = ['never', 'source', 'both']
|
valid_merge_request = ['never', 'source', 'both']
|
||||||
|
|
||||||
@ -1205,7 +1205,7 @@ def gitlab(parser, xml_parent, data):
|
|||||||
_add_xml(gitlab, xml_name, value)
|
_add_xml(gitlab, xml_name, value)
|
||||||
|
|
||||||
|
|
||||||
def build_result(parser, xml_parent, data):
|
def build_result(registry, xml_parent, data):
|
||||||
"""yaml: build-result
|
"""yaml: build-result
|
||||||
Configure jobB to monitor jobA build result. A build is scheduled if there
|
Configure jobB to monitor jobA build result. A build is scheduled if there
|
||||||
is a new build result that matches your criteria (unstable, failure, ...).
|
is a new build result that matches your criteria (unstable, failure, ...).
|
||||||
@ -1272,7 +1272,7 @@ def build_result(parser, xml_parent, data):
|
|||||||
XML.SubElement(model_checked, 'checked').text = result_dict[result]
|
XML.SubElement(model_checked, 'checked').text = result_dict[result]
|
||||||
|
|
||||||
|
|
||||||
def reverse(parser, xml_parent, data):
|
def reverse(registry, xml_parent, data):
|
||||||
"""yaml: reverse
|
"""yaml: reverse
|
||||||
This trigger can be configured in the UI using the checkbox with the
|
This trigger can be configured in the UI using the checkbox with the
|
||||||
following text: 'Build after other projects are built'.
|
following text: 'Build after other projects are built'.
|
||||||
@ -1327,7 +1327,7 @@ def reverse(parser, xml_parent, data):
|
|||||||
str(hudson_model.THRESHOLDS[result]['complete']).lower()
|
str(hudson_model.THRESHOLDS[result]['complete']).lower()
|
||||||
|
|
||||||
|
|
||||||
def monitor_folders(parser, xml_parent, data):
|
def monitor_folders(registry, xml_parent, data):
|
||||||
"""yaml: monitor-folders
|
"""yaml: monitor-folders
|
||||||
Configure Jenkins to monitor folders.
|
Configure Jenkins to monitor folders.
|
||||||
Requires the Jenkins :jenkins-wiki:`Filesystem Trigger Plugin
|
Requires the Jenkins :jenkins-wiki:`Filesystem Trigger Plugin
|
||||||
@ -1370,7 +1370,7 @@ def monitor_folders(parser, xml_parent, data):
|
|||||||
not data.get('check-fewer', True)).lower()
|
not data.get('check-fewer', True)).lower()
|
||||||
|
|
||||||
|
|
||||||
def monitor_files(parser, xml_parent, data):
|
def monitor_files(registry, xml_parent, data):
|
||||||
"""yaml: monitor-files
|
"""yaml: monitor-files
|
||||||
Configure Jenkins to monitor files.
|
Configure Jenkins to monitor files.
|
||||||
Requires the Jenkins :jenkins-wiki:`Filesystem Trigger Plugin
|
Requires the Jenkins :jenkins-wiki:`Filesystem Trigger Plugin
|
||||||
@ -1514,7 +1514,7 @@ def monitor_files(parser, xml_parent, data):
|
|||||||
file_info.get('ignore-modificaton-date', True)).lower()
|
file_info.get('ignore-modificaton-date', True)).lower()
|
||||||
|
|
||||||
|
|
||||||
def ivy(parser, xml_parent, data):
|
def ivy(registry, xml_parent, data):
|
||||||
"""yaml: ivy
|
"""yaml: ivy
|
||||||
Poll with an Ivy script
|
Poll with an Ivy script
|
||||||
Requires the Jenkins :jenkins-wiki:`IvyTrigger Plugin
|
Requires the Jenkins :jenkins-wiki:`IvyTrigger Plugin
|
||||||
@ -1562,7 +1562,7 @@ def ivy(parser, xml_parent, data):
|
|||||||
XML.SubElement(it, 'triggerLabel').text = label
|
XML.SubElement(it, 'triggerLabel').text = label
|
||||||
|
|
||||||
|
|
||||||
def script(parser, xml_parent, data):
|
def script(registry, xml_parent, data):
|
||||||
"""yaml: script
|
"""yaml: script
|
||||||
Triggers the job using shell or batch script.
|
Triggers the job using shell or batch script.
|
||||||
Requires the Jenkins :jenkins-wiki:`ScriptTrigger Plugin
|
Requires the Jenkins :jenkins-wiki:`ScriptTrigger Plugin
|
||||||
@ -1607,7 +1607,7 @@ def script(parser, xml_parent, data):
|
|||||||
XML.SubElement(st, 'triggerLabel').text = label
|
XML.SubElement(st, 'triggerLabel').text = label
|
||||||
|
|
||||||
|
|
||||||
def groovy_script(parser, xml_parent, data):
|
def groovy_script(registry, xml_parent, data):
|
||||||
"""yaml: groovy-script
|
"""yaml: groovy-script
|
||||||
Triggers the job using a groovy script.
|
Triggers the job using a groovy script.
|
||||||
Requires the Jenkins :jenkins-wiki:`ScriptTrigger Plugin
|
Requires the Jenkins :jenkins-wiki:`ScriptTrigger Plugin
|
||||||
@ -1659,7 +1659,7 @@ def groovy_script(parser, xml_parent, data):
|
|||||||
XML.SubElement(gst, 'triggerLabel').text = label
|
XML.SubElement(gst, 'triggerLabel').text = label
|
||||||
|
|
||||||
|
|
||||||
def rabbitmq(parser, xml_parent, data):
|
def rabbitmq(registry, xml_parent, data):
|
||||||
"""yaml: rabbitmq
|
"""yaml: rabbitmq
|
||||||
This plugin triggers build using remote build message in RabbitMQ queue.
|
This plugin triggers build using remote build message in RabbitMQ queue.
|
||||||
Requires the Jenkins :jenkins-wiki:`RabbitMQ Build Trigger Plugin
|
Requires the Jenkins :jenkins-wiki:`RabbitMQ Build Trigger Plugin
|
||||||
@ -1693,11 +1693,11 @@ class Triggers(jenkins_jobs.modules.base.Base):
|
|||||||
component_type = 'trigger'
|
component_type = 'trigger'
|
||||||
component_list_type = 'triggers'
|
component_list_type = 'triggers'
|
||||||
|
|
||||||
def gen_xml(self, parser, xml_parent, data):
|
def gen_xml(self, xml_parent, data):
|
||||||
triggers = data.get('triggers', [])
|
triggers = data.get('triggers', [])
|
||||||
if not triggers:
|
if not triggers:
|
||||||
return
|
return
|
||||||
|
|
||||||
trig_e = XML.SubElement(xml_parent, 'triggers', {'class': 'vector'})
|
trig_e = XML.SubElement(xml_parent, 'triggers', {'class': 'vector'})
|
||||||
for trigger in triggers:
|
for trigger in triggers:
|
||||||
self.registry.dispatch('trigger', parser, trig_e, trigger)
|
self.registry.dispatch('trigger', trig_e, trigger)
|
||||||
|
@ -44,7 +44,7 @@ logger = logging.getLogger(__name__)
|
|||||||
MIN_TO_SEC = 60
|
MIN_TO_SEC = 60
|
||||||
|
|
||||||
|
|
||||||
def docker_custom_build_env(parser, xml_parent, data):
|
def docker_custom_build_env(registry, xml_parent, data):
|
||||||
"""yaml: docker-custom-build-env
|
"""yaml: docker-custom-build-env
|
||||||
Allows the definition of a build environment for a job using a Docker
|
Allows the definition of a build environment for a job using a Docker
|
||||||
container.
|
container.
|
||||||
@ -155,7 +155,7 @@ def docker_custom_build_env(parser, xml_parent, data):
|
|||||||
XML.SubElement(entry_xml, 'net').text = data.get('net', 'bridge')
|
XML.SubElement(entry_xml, 'net').text = data.get('net', 'bridge')
|
||||||
|
|
||||||
|
|
||||||
def ci_skip(parser, xml_parent, data):
|
def ci_skip(registry, xml_parent, data):
|
||||||
"""yaml: ci-skip
|
"""yaml: ci-skip
|
||||||
Skip making a build for certain push.
|
Skip making a build for certain push.
|
||||||
Just add [ci skip] into your commit's message to let Jenkins know,
|
Just add [ci skip] into your commit's message to let Jenkins know,
|
||||||
@ -183,7 +183,7 @@ def ci_skip(parser, xml_parent, data):
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
def config_file_provider(parser, xml_parent, data):
|
def config_file_provider(registry, xml_parent, data):
|
||||||
"""yaml: config-file-provider
|
"""yaml: config-file-provider
|
||||||
Provide configuration files (i.e., settings.xml for maven etc.)
|
Provide configuration files (i.e., settings.xml for maven etc.)
|
||||||
which will be copied to the job's workspace.
|
which will be copied to the job's workspace.
|
||||||
@ -212,7 +212,7 @@ def config_file_provider(parser, xml_parent, data):
|
|||||||
config_file_provider_builder(cfp, data)
|
config_file_provider_builder(cfp, data)
|
||||||
|
|
||||||
|
|
||||||
def logfilesize(parser, xml_parent, data):
|
def logfilesize(registry, xml_parent, data):
|
||||||
"""yaml: logfilesize
|
"""yaml: logfilesize
|
||||||
Abort the build if its logfile becomes too big.
|
Abort the build if its logfile becomes too big.
|
||||||
Requires the Jenkins :jenkins-wiki:`Logfilesizechecker Plugin
|
Requires the Jenkins :jenkins-wiki:`Logfilesizechecker Plugin
|
||||||
@ -246,7 +246,7 @@ def logfilesize(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(lfswrapper, data, mapping, fail_required=True)
|
convert_mapping_to_xml(lfswrapper, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def timeout(parser, xml_parent, data):
|
def timeout(registry, xml_parent, data):
|
||||||
"""yaml: timeout
|
"""yaml: timeout
|
||||||
Abort the build if it runs too long.
|
Abort the build if it runs too long.
|
||||||
Requires the Jenkins :jenkins-wiki:`Build Timeout Plugin
|
Requires the Jenkins :jenkins-wiki:`Build Timeout Plugin
|
||||||
@ -310,7 +310,7 @@ def timeout(parser, xml_parent, data):
|
|||||||
prefix = 'hudson.plugins.build__timeout.'
|
prefix = 'hudson.plugins.build__timeout.'
|
||||||
twrapper = XML.SubElement(xml_parent, prefix + 'BuildTimeoutWrapper')
|
twrapper = XML.SubElement(xml_parent, prefix + 'BuildTimeoutWrapper')
|
||||||
|
|
||||||
plugin_info = parser.registry.get_plugin_info(
|
plugin_info = registry.get_plugin_info(
|
||||||
"Jenkins build timeout plugin")
|
"Jenkins build timeout plugin")
|
||||||
version = pkg_resources.parse_version(plugin_info.get("version", "0"))
|
version = pkg_resources.parse_version(plugin_info.get("version", "0"))
|
||||||
|
|
||||||
@ -425,7 +425,7 @@ def timeout(parser, xml_parent, data):
|
|||||||
XML.SubElement(twrapper, 'timeoutType').text = tout_type
|
XML.SubElement(twrapper, 'timeoutType').text = tout_type
|
||||||
|
|
||||||
|
|
||||||
def timestamps(parser, xml_parent, data):
|
def timestamps(registry, xml_parent, data):
|
||||||
"""yaml: timestamps
|
"""yaml: timestamps
|
||||||
Add timestamps to the console log.
|
Add timestamps to the console log.
|
||||||
Requires the Jenkins :jenkins-wiki:`Timestamper Plugin <Timestamper>`.
|
Requires the Jenkins :jenkins-wiki:`Timestamper Plugin <Timestamper>`.
|
||||||
@ -439,7 +439,7 @@ def timestamps(parser, xml_parent, data):
|
|||||||
'hudson.plugins.timestamper.TimestamperBuildWrapper')
|
'hudson.plugins.timestamper.TimestamperBuildWrapper')
|
||||||
|
|
||||||
|
|
||||||
def ansicolor(parser, xml_parent, data):
|
def ansicolor(registry, xml_parent, data):
|
||||||
"""yaml: ansicolor
|
"""yaml: ansicolor
|
||||||
Translate ANSI color codes to HTML in the console log.
|
Translate ANSI color codes to HTML in the console log.
|
||||||
Requires the Jenkins :jenkins-wiki:`Ansi Color Plugin <AnsiColor+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Ansi Color Plugin <AnsiColor+Plugin>`.
|
||||||
@ -466,7 +466,7 @@ def ansicolor(parser, xml_parent, data):
|
|||||||
XML.SubElement(cwrapper, 'colorMapName').text = colormap
|
XML.SubElement(cwrapper, 'colorMapName').text = colormap
|
||||||
|
|
||||||
|
|
||||||
def build_keeper(parser, xml_parent, data):
|
def build_keeper(registry, xml_parent, data):
|
||||||
"""yaml: build-keeper
|
"""yaml: build-keeper
|
||||||
Keep builds based on specific policy.
|
Keep builds based on specific policy.
|
||||||
Requires the Jenkins :jenkins-wiki:`Build Keeper Plugin
|
Requires the Jenkins :jenkins-wiki:`Build Keeper Plugin
|
||||||
@ -539,7 +539,7 @@ def build_keeper(parser, xml_parent, data):
|
|||||||
InvalidAttributeError('policy', policy, valid_policies)
|
InvalidAttributeError('policy', policy, valid_policies)
|
||||||
|
|
||||||
|
|
||||||
def live_screenshot(parser, xml_parent, data):
|
def live_screenshot(registry, xml_parent, data):
|
||||||
"""yaml: live-screenshot
|
"""yaml: live-screenshot
|
||||||
Show live screenshots of running jobs in the job list.
|
Show live screenshots of running jobs in the job list.
|
||||||
Requires the Jenkins :jenkins-wiki:`Live-Screenshot Plugin
|
Requires the Jenkins :jenkins-wiki:`Live-Screenshot Plugin
|
||||||
@ -571,7 +571,7 @@ def live_screenshot(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(live, data, mapping, fail_required=True)
|
convert_mapping_to_xml(live, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def mask_passwords(parser, xml_parent, data):
|
def mask_passwords(registry, xml_parent, data):
|
||||||
"""yaml: mask-passwords
|
"""yaml: mask-passwords
|
||||||
Hide passwords in the console log.
|
Hide passwords in the console log.
|
||||||
Requires the Jenkins :jenkins-wiki:`Mask Passwords Plugin
|
Requires the Jenkins :jenkins-wiki:`Mask Passwords Plugin
|
||||||
@ -587,7 +587,7 @@ def mask_passwords(parser, xml_parent, data):
|
|||||||
'MaskPasswordsBuildWrapper')
|
'MaskPasswordsBuildWrapper')
|
||||||
|
|
||||||
|
|
||||||
def workspace_cleanup(parser, xml_parent, data):
|
def workspace_cleanup(registry, xml_parent, data):
|
||||||
"""yaml: workspace-cleanup (pre-build)
|
"""yaml: workspace-cleanup (pre-build)
|
||||||
|
|
||||||
Requires the Jenkins :jenkins-wiki:`Workspace Cleanup Plugin
|
Requires the Jenkins :jenkins-wiki:`Workspace Cleanup Plugin
|
||||||
@ -636,7 +636,7 @@ def workspace_cleanup(parser, xml_parent, data):
|
|||||||
data.get('external-deletion-command', ''))
|
data.get('external-deletion-command', ''))
|
||||||
|
|
||||||
|
|
||||||
def m2_repository_cleanup(parser, xml_parent, data):
|
def m2_repository_cleanup(registry, xml_parent, data):
|
||||||
"""yaml: m2-repository-cleanup
|
"""yaml: m2-repository-cleanup
|
||||||
Configure M2 Repository Cleanup
|
Configure M2 Repository Cleanup
|
||||||
Requires the Jenkins :jenkins-wiki:`M2 Repository Cleanup
|
Requires the Jenkins :jenkins-wiki:`M2 Repository Cleanup
|
||||||
@ -664,7 +664,7 @@ def m2_repository_cleanup(parser, xml_parent, data):
|
|||||||
XML.SubElement(p, 'string').text = pattern
|
XML.SubElement(p, 'string').text = pattern
|
||||||
|
|
||||||
|
|
||||||
def rvm_env(parser, xml_parent, data):
|
def rvm_env(registry, xml_parent, data):
|
||||||
"""yaml: rvm-env
|
"""yaml: rvm-env
|
||||||
Set the RVM implementation
|
Set the RVM implementation
|
||||||
Requires the Jenkins :jenkins-wiki:`Rvm Plugin <RVM+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Rvm Plugin <RVM+Plugin>`.
|
||||||
@ -703,7 +703,7 @@ def rvm_env(parser, xml_parent, data):
|
|||||||
'ruby-class': 'String'}).text = "rvm"
|
'ruby-class': 'String'}).text = "rvm"
|
||||||
|
|
||||||
|
|
||||||
def rbenv(parser, xml_parent, data):
|
def rbenv(registry, xml_parent, data):
|
||||||
"""yaml: rbenv
|
"""yaml: rbenv
|
||||||
Set the rbenv implementation.
|
Set the rbenv implementation.
|
||||||
Requires the Jenkins :jenkins-wiki:`rbenv plugin <rbenv+plugin>`.
|
Requires the Jenkins :jenkins-wiki:`rbenv plugin <rbenv+plugin>`.
|
||||||
@ -788,7 +788,7 @@ def rbenv(parser, xml_parent, data):
|
|||||||
'pluginid': 'rbenv'})
|
'pluginid': 'rbenv'})
|
||||||
|
|
||||||
|
|
||||||
def build_name(parser, xml_parent, data):
|
def build_name(registry, xml_parent, data):
|
||||||
"""yaml: build-name
|
"""yaml: build-name
|
||||||
Set the name of the build
|
Set the name of the build
|
||||||
Requires the Jenkins :jenkins-wiki:`Build Name Setter Plugin
|
Requires the Jenkins :jenkins-wiki:`Build Name Setter Plugin
|
||||||
@ -810,7 +810,7 @@ def build_name(parser, xml_parent, data):
|
|||||||
XML.SubElement(bsetter, 'template').text = data['name']
|
XML.SubElement(bsetter, 'template').text = data['name']
|
||||||
|
|
||||||
|
|
||||||
def port_allocator(parser, xml_parent, data):
|
def port_allocator(registry, xml_parent, data):
|
||||||
"""yaml: port-allocator
|
"""yaml: port-allocator
|
||||||
Assign unique TCP port numbers
|
Assign unique TCP port numbers
|
||||||
Requires the Jenkins :jenkins-wiki:`Port Allocator Plugin
|
Requires the Jenkins :jenkins-wiki:`Port Allocator Plugin
|
||||||
@ -841,7 +841,7 @@ def port_allocator(parser, xml_parent, data):
|
|||||||
XML.SubElement(dpt, 'name').text = name
|
XML.SubElement(dpt, 'name').text = name
|
||||||
|
|
||||||
|
|
||||||
def locks(parser, xml_parent, data):
|
def locks(registry, xml_parent, data):
|
||||||
"""yaml: locks
|
"""yaml: locks
|
||||||
Control parallel execution of jobs.
|
Control parallel execution of jobs.
|
||||||
Requires the Jenkins :jenkins-wiki:`Locks and Latches Plugin
|
Requires the Jenkins :jenkins-wiki:`Locks and Latches Plugin
|
||||||
@ -866,7 +866,7 @@ def locks(parser, xml_parent, data):
|
|||||||
XML.SubElement(lockwrapper, 'name').text = lock
|
XML.SubElement(lockwrapper, 'name').text = lock
|
||||||
|
|
||||||
|
|
||||||
def copy_to_slave(parser, xml_parent, data):
|
def copy_to_slave(registry, xml_parent, data):
|
||||||
"""yaml: copy-to-slave
|
"""yaml: copy-to-slave
|
||||||
Copy files to slave before build
|
Copy files to slave before build
|
||||||
Requires the Jenkins :jenkins-wiki:`Copy To Slave Plugin
|
Requires the Jenkins :jenkins-wiki:`Copy To Slave Plugin
|
||||||
@ -912,7 +912,7 @@ def copy_to_slave(parser, xml_parent, data):
|
|||||||
XML.SubElement(cs, 'hudsonHomeRelative').text = 'false'
|
XML.SubElement(cs, 'hudsonHomeRelative').text = 'false'
|
||||||
|
|
||||||
|
|
||||||
def inject(parser, xml_parent, data):
|
def inject(registry, xml_parent, data):
|
||||||
"""yaml: inject
|
"""yaml: inject
|
||||||
Add or override environment variables to the whole build process
|
Add or override environment variables to the whole build process
|
||||||
Requires the Jenkins :jenkins-wiki:`EnvInject Plugin <EnvInject+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`EnvInject Plugin <EnvInject+Plugin>`.
|
||||||
@ -944,7 +944,7 @@ def inject(parser, xml_parent, data):
|
|||||||
XML.SubElement(info, 'loadFilesFromMaster').text = 'false'
|
XML.SubElement(info, 'loadFilesFromMaster').text = 'false'
|
||||||
|
|
||||||
|
|
||||||
def inject_ownership_variables(parser, xml_parent, data):
|
def inject_ownership_variables(registry, xml_parent, data):
|
||||||
"""yaml: inject-ownership-variables
|
"""yaml: inject-ownership-variables
|
||||||
Inject ownership variables to the build as environment variables.
|
Inject ownership variables to the build as environment variables.
|
||||||
Requires the Jenkins :jenkins-wiki:`EnvInject Plugin <EnvInject+Plugin>`
|
Requires the Jenkins :jenkins-wiki:`EnvInject Plugin <EnvInject+Plugin>`
|
||||||
@ -968,7 +968,7 @@ def inject_ownership_variables(parser, xml_parent, data):
|
|||||||
str(data.get('job-variables', False)).lower()
|
str(data.get('job-variables', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def inject_passwords(parser, xml_parent, data):
|
def inject_passwords(registry, xml_parent, data):
|
||||||
"""yaml: inject-passwords
|
"""yaml: inject-passwords
|
||||||
Inject passwords to the build as environment variables.
|
Inject passwords to the build as environment variables.
|
||||||
Requires the Jenkins :jenkins-wiki:`EnvInject Plugin <EnvInject+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`EnvInject Plugin <EnvInject+Plugin>`.
|
||||||
@ -999,7 +999,7 @@ def inject_passwords(parser, xml_parent, data):
|
|||||||
XML.SubElement(entry, 'value').text = password['password']
|
XML.SubElement(entry, 'value').text = password['password']
|
||||||
|
|
||||||
|
|
||||||
def env_file(parser, xml_parent, data):
|
def env_file(registry, xml_parent, data):
|
||||||
"""yaml: env-file
|
"""yaml: env-file
|
||||||
Add or override environment variables to the whole build process
|
Add or override environment variables to the whole build process
|
||||||
Requires the Jenkins :jenkins-wiki:`Environment File Plugin
|
Requires the Jenkins :jenkins-wiki:`Environment File Plugin
|
||||||
@ -1019,7 +1019,7 @@ def env_file(parser, xml_parent, data):
|
|||||||
eib, 'filePath', data.get('properties-file'))
|
eib, 'filePath', data.get('properties-file'))
|
||||||
|
|
||||||
|
|
||||||
def env_script(parser, xml_parent, data):
|
def env_script(registry, xml_parent, data):
|
||||||
"""yaml: env-script
|
"""yaml: env-script
|
||||||
Add or override environment variables to the whole build process.
|
Add or override environment variables to the whole build process.
|
||||||
Requires the Jenkins :jenkins-wiki:`Environment Script Plugin
|
Requires the Jenkins :jenkins-wiki:`Environment Script Plugin
|
||||||
@ -1058,7 +1058,7 @@ def env_script(parser, xml_parent, data):
|
|||||||
XML.SubElement(el, 'onlyRunOnParent').text = only_on_parent
|
XML.SubElement(el, 'onlyRunOnParent').text = only_on_parent
|
||||||
|
|
||||||
|
|
||||||
def jclouds(parser, xml_parent, data):
|
def jclouds(registry, xml_parent, data):
|
||||||
"""yaml: jclouds
|
"""yaml: jclouds
|
||||||
Uses JClouds to provide slave launching on most of the currently
|
Uses JClouds to provide slave launching on most of the currently
|
||||||
usable Cloud infrastructures.
|
usable Cloud infrastructures.
|
||||||
@ -1111,7 +1111,7 @@ def jclouds(parser, xml_parent, data):
|
|||||||
'JCloudsOneOffSlave')
|
'JCloudsOneOffSlave')
|
||||||
|
|
||||||
|
|
||||||
def openstack(parser, xml_parent, data):
|
def openstack(registry, xml_parent, data):
|
||||||
"""yaml: openstack
|
"""yaml: openstack
|
||||||
Provision slaves from OpenStack on demand. Requires the Jenkins
|
Provision slaves from OpenStack on demand. Requires the Jenkins
|
||||||
:jenkins-wiki:`Openstack Cloud Plugin <Openstack+Cloud+Plugin>`.
|
:jenkins-wiki:`Openstack Cloud Plugin <Openstack+Cloud+Plugin>`.
|
||||||
@ -1172,7 +1172,7 @@ def openstack(parser, xml_parent, data):
|
|||||||
XML.SubElement(xml_parent, tag_prefix + 'JCloudsOneOffSlave')
|
XML.SubElement(xml_parent, tag_prefix + 'JCloudsOneOffSlave')
|
||||||
|
|
||||||
|
|
||||||
def build_user_vars(parser, xml_parent, data):
|
def build_user_vars(registry, xml_parent, data):
|
||||||
"""yaml: build-user-vars
|
"""yaml: build-user-vars
|
||||||
Set environment variables to the value of the user that started the build.
|
Set environment variables to the value of the user that started the build.
|
||||||
Requires the Jenkins :jenkins-wiki:`Build User Vars Plugin
|
Requires the Jenkins :jenkins-wiki:`Build User Vars Plugin
|
||||||
@ -1186,7 +1186,7 @@ def build_user_vars(parser, xml_parent, data):
|
|||||||
XML.SubElement(xml_parent, 'org.jenkinsci.plugins.builduser.BuildUser')
|
XML.SubElement(xml_parent, 'org.jenkinsci.plugins.builduser.BuildUser')
|
||||||
|
|
||||||
|
|
||||||
def release(parser, xml_parent, data):
|
def release(registry, xml_parent, data):
|
||||||
"""yaml: release
|
"""yaml: release
|
||||||
Add release build configuration
|
Add release build configuration
|
||||||
Requires the Jenkins :jenkins-wiki:`Release Plugin <Release+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Release Plugin <Release+Plugin>`.
|
||||||
@ -1222,7 +1222,7 @@ def release(parser, xml_parent, data):
|
|||||||
if parameters:
|
if parameters:
|
||||||
pdef = XML.SubElement(relwrap, 'parameterDefinitions')
|
pdef = XML.SubElement(relwrap, 'parameterDefinitions')
|
||||||
for param in parameters:
|
for param in parameters:
|
||||||
parser.registry.dispatch('parameter', parser, pdef, param)
|
registry.dispatch('parameter', pdef, param)
|
||||||
|
|
||||||
builder_steps = {
|
builder_steps = {
|
||||||
'pre-build': 'preBuildSteps',
|
'pre-build': 'preBuildSteps',
|
||||||
@ -1232,13 +1232,12 @@ def release(parser, xml_parent, data):
|
|||||||
}
|
}
|
||||||
for step in builder_steps.keys():
|
for step in builder_steps.keys():
|
||||||
for builder in data.get(step, []):
|
for builder in data.get(step, []):
|
||||||
parser.registry.dispatch('builder', parser,
|
registry.dispatch('builder',
|
||||||
XML.SubElement(relwrap,
|
XML.SubElement(relwrap, builder_steps[step]),
|
||||||
builder_steps[step]),
|
|
||||||
builder)
|
builder)
|
||||||
|
|
||||||
|
|
||||||
def sauce_ondemand(parser, xml_parent, data):
|
def sauce_ondemand(registry, xml_parent, data):
|
||||||
"""yaml: sauce-ondemand
|
"""yaml: sauce-ondemand
|
||||||
Allows you to integrate Sauce OnDemand with Jenkins. You can
|
Allows you to integrate Sauce OnDemand with Jenkins. You can
|
||||||
automate the setup and tear down of Sauce Connect and integrate
|
automate the setup and tear down of Sauce Connect and integrate
|
||||||
@ -1342,7 +1341,7 @@ def sauce_ondemand(parser, xml_parent, data):
|
|||||||
XML.SubElement(sauce, 'options').text = options
|
XML.SubElement(sauce, 'options').text = options
|
||||||
|
|
||||||
|
|
||||||
def pathignore(parser, xml_parent, data):
|
def pathignore(registry, xml_parent, data):
|
||||||
"""yaml: pathignore
|
"""yaml: pathignore
|
||||||
This plugin allows SCM-triggered jobs to ignore
|
This plugin allows SCM-triggered jobs to ignore
|
||||||
build requests if only certain paths have changed.
|
build requests if only certain paths have changed.
|
||||||
@ -1378,7 +1377,7 @@ def pathignore(parser, xml_parent, data):
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
def pre_scm_buildstep(parser, xml_parent, data):
|
def pre_scm_buildstep(registry, xml_parent, data):
|
||||||
"""yaml: pre-scm-buildstep
|
"""yaml: pre-scm-buildstep
|
||||||
Execute a Build Step before running the SCM
|
Execute a Build Step before running the SCM
|
||||||
Requires the Jenkins :jenkins-wiki:`pre-scm-buildstep <pre-scm-buildstep>`.
|
Requires the Jenkins :jenkins-wiki:`pre-scm-buildstep <pre-scm-buildstep>`.
|
||||||
@ -1408,11 +1407,11 @@ def pre_scm_buildstep(parser, xml_parent, data):
|
|||||||
'PreSCMBuildStepsWrapper')
|
'PreSCMBuildStepsWrapper')
|
||||||
bs = XML.SubElement(bsp, 'buildSteps')
|
bs = XML.SubElement(bsp, 'buildSteps')
|
||||||
for step in data:
|
for step in data:
|
||||||
for edited_node in create_builders(parser, step):
|
for edited_node in create_builders(registry, step):
|
||||||
bs.append(edited_node)
|
bs.append(edited_node)
|
||||||
|
|
||||||
|
|
||||||
def logstash(parser, xml_parent, data):
|
def logstash(registry, xml_parent, data):
|
||||||
"""yaml: logstash build wrapper
|
"""yaml: logstash build wrapper
|
||||||
Dump the Jenkins console output to Logstash
|
Dump the Jenkins console output to Logstash
|
||||||
Requires the Jenkins :jenkins-wiki:`logstash plugin <Logstash+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`logstash plugin <Logstash+Plugin>`.
|
||||||
@ -1471,7 +1470,7 @@ def logstash(parser, xml_parent, data):
|
|||||||
key_sub_element.text = str(redis_config.get('key', 'logstash'))
|
key_sub_element.text = str(redis_config.get('key', 'logstash'))
|
||||||
|
|
||||||
|
|
||||||
def mongo_db(parser, xml_parent, data):
|
def mongo_db(registry, xml_parent, data):
|
||||||
"""yaml: mongo-db build wrapper
|
"""yaml: mongo-db build wrapper
|
||||||
Initalizes a MongoDB database while running the build.
|
Initalizes a MongoDB database while running the build.
|
||||||
Requires the Jenkins :jenkins-wiki:`MongoDB plugin <MongoDB+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`MongoDB plugin <MongoDB+Plugin>`.
|
||||||
@ -1506,7 +1505,7 @@ def mongo_db(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(mongodb, data, mapping, fail_required=True)
|
convert_mapping_to_xml(mongodb, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def delivery_pipeline(parser, xml_parent, data):
|
def delivery_pipeline(registry, xml_parent, data):
|
||||||
"""yaml: delivery-pipeline
|
"""yaml: delivery-pipeline
|
||||||
If enabled the job will create a version based on the template.
|
If enabled the job will create a version based on the template.
|
||||||
The version will be set to the environment variable PIPELINE_VERSION and
|
The version will be set to the environment variable PIPELINE_VERSION and
|
||||||
@ -1543,7 +1542,7 @@ def delivery_pipeline(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(pvc, data, mapping, fail_required=True)
|
convert_mapping_to_xml(pvc, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def matrix_tie_parent(parser, xml_parent, data):
|
def matrix_tie_parent(registry, xml_parent, data):
|
||||||
"""yaml: matrix-tie-parent
|
"""yaml: matrix-tie-parent
|
||||||
Tie parent to a node.
|
Tie parent to a node.
|
||||||
Requires the Jenkins :jenkins-wiki:`Matrix Tie Parent Plugin
|
Requires the Jenkins :jenkins-wiki:`Matrix Tie Parent Plugin
|
||||||
@ -1563,7 +1562,7 @@ def matrix_tie_parent(parser, xml_parent, data):
|
|||||||
XML.SubElement(mtp, 'labelName').text = data['node']
|
XML.SubElement(mtp, 'labelName').text = data['node']
|
||||||
|
|
||||||
|
|
||||||
def exclusion(parser, xml_parent, data):
|
def exclusion(registry, xml_parent, data):
|
||||||
"""yaml: exclusion
|
"""yaml: exclusion
|
||||||
Add a resource to use for critical sections to establish a mutex on. If
|
Add a resource to use for critical sections to establish a mutex on. If
|
||||||
another job specifies the same resource, the second job will wait for the
|
another job specifies the same resource, the second job will wait for the
|
||||||
@ -1590,7 +1589,7 @@ def exclusion(parser, xml_parent, data):
|
|||||||
XML.SubElement(dit, 'name').text = str(resource).upper()
|
XML.SubElement(dit, 'name').text = str(resource).upper()
|
||||||
|
|
||||||
|
|
||||||
def ssh_agent_credentials(parser, xml_parent, data):
|
def ssh_agent_credentials(registry, xml_parent, data):
|
||||||
"""yaml: ssh-agent-credentials
|
"""yaml: ssh-agent-credentials
|
||||||
Sets up the user for the ssh agent plugin for jenkins.
|
Sets up the user for the ssh agent plugin for jenkins.
|
||||||
|
|
||||||
@ -1658,7 +1657,7 @@ def ssh_agent_credentials(parser, xml_parent, data):
|
|||||||
XML.SubElement(entry_xml, xml_key).text = user
|
XML.SubElement(entry_xml, xml_key).text = user
|
||||||
|
|
||||||
|
|
||||||
def credentials_binding(parser, xml_parent, data):
|
def credentials_binding(registry, xml_parent, data):
|
||||||
"""yaml: credentials-binding
|
"""yaml: credentials-binding
|
||||||
Binds credentials to environment variables using the credentials binding
|
Binds credentials to environment variables using the credentials binding
|
||||||
plugin for jenkins.
|
plugin for jenkins.
|
||||||
@ -1762,7 +1761,7 @@ def credentials_binding(parser, xml_parent, data):
|
|||||||
credential_xml.text = params.get('credential-id')
|
credential_xml.text = params.get('credential-id')
|
||||||
|
|
||||||
|
|
||||||
def custom_tools(parser, xml_parent, data):
|
def custom_tools(registry, xml_parent, data):
|
||||||
"""yaml: custom-tools
|
"""yaml: custom-tools
|
||||||
Requires the Jenkins :jenkins-wiki:`Custom Tools Plugin
|
Requires the Jenkins :jenkins-wiki:`Custom Tools Plugin
|
||||||
<Custom+Tools+Plugin>`.
|
<Custom+Tools+Plugin>`.
|
||||||
@ -1800,7 +1799,7 @@ def custom_tools(parser, xml_parent, data):
|
|||||||
'convertHomesToUppercase').text = convert_home
|
'convertHomesToUppercase').text = convert_home
|
||||||
|
|
||||||
|
|
||||||
def nodejs_installator(parser, xml_parent, data):
|
def nodejs_installator(registry, xml_parent, data):
|
||||||
"""yaml: nodejs-installator
|
"""yaml: nodejs-installator
|
||||||
Requires the Jenkins :jenkins-wiki:`NodeJS Plugin
|
Requires the Jenkins :jenkins-wiki:`NodeJS Plugin
|
||||||
<NodeJS+Plugin>`.
|
<NodeJS+Plugin>`.
|
||||||
@ -1822,7 +1821,7 @@ def nodejs_installator(parser, xml_parent, data):
|
|||||||
raise MissingAttributeError(e.args[0])
|
raise MissingAttributeError(e.args[0])
|
||||||
|
|
||||||
|
|
||||||
def xvnc(parser, xml_parent, data):
|
def xvnc(registry, xml_parent, data):
|
||||||
"""yaml: xvnc
|
"""yaml: xvnc
|
||||||
Enable xvnc during the build.
|
Enable xvnc during the build.
|
||||||
Requires the Jenkins :jenkins-wiki:`xvnc plugin <Xvnc+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`xvnc plugin <Xvnc+Plugin>`.
|
||||||
@ -1852,7 +1851,7 @@ def xvnc(parser, xml_parent, data):
|
|||||||
convert_mapping_to_xml(xwrapper, data, mapping, fail_required=True)
|
convert_mapping_to_xml(xwrapper, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def job_log_logger(parser, xml_parent, data):
|
def job_log_logger(registry, xml_parent, data):
|
||||||
"""yaml: job-log-logger
|
"""yaml: job-log-logger
|
||||||
Enable writing the job log to the underlying logging system.
|
Enable writing the job log to the underlying logging system.
|
||||||
Requires the Jenkins :jenkins-wiki:`Job Log Logger plugin
|
Requires the Jenkins :jenkins-wiki:`Job Log Logger plugin
|
||||||
@ -1873,7 +1872,7 @@ def job_log_logger(parser, xml_parent, data):
|
|||||||
data.get('suppress-empty', True)).lower()
|
data.get('suppress-empty', True)).lower()
|
||||||
|
|
||||||
|
|
||||||
def xvfb(parser, xml_parent, data):
|
def xvfb(registry, xml_parent, data):
|
||||||
"""yaml: xvfb
|
"""yaml: xvfb
|
||||||
Enable xvfb during the build.
|
Enable xvfb during the build.
|
||||||
Requires the Jenkins :jenkins-wiki:`Xvfb Plugin <Xvfb+Plugin>`.
|
Requires the Jenkins :jenkins-wiki:`Xvfb Plugin <Xvfb+Plugin>`.
|
||||||
@ -1934,7 +1933,7 @@ def xvfb(parser, xml_parent, data):
|
|||||||
'shutdown-with-build', False)).lower()
|
'shutdown-with-build', False)).lower()
|
||||||
|
|
||||||
|
|
||||||
def android_emulator(parser, xml_parent, data):
|
def android_emulator(registry, xml_parent, data):
|
||||||
"""yaml: android-emulator
|
"""yaml: android-emulator
|
||||||
Automates many Android development tasks including SDK installation,
|
Automates many Android development tasks including SDK installation,
|
||||||
build file generation, emulator creation and launch,
|
build file generation, emulator creation and launch,
|
||||||
@ -2020,7 +2019,7 @@ def android_emulator(parser, xml_parent, data):
|
|||||||
XML.SubElement(root, 'executable').text = str(data.get('exe', ''))
|
XML.SubElement(root, 'executable').text = str(data.get('exe', ''))
|
||||||
|
|
||||||
|
|
||||||
def artifactory_maven(parser, xml_parent, data):
|
def artifactory_maven(registry, xml_parent, data):
|
||||||
"""yaml: artifactory-maven
|
"""yaml: artifactory-maven
|
||||||
Wrapper for non-Maven projects. Requires the
|
Wrapper for non-Maven projects. Requires the
|
||||||
:jenkins-wiki:`Artifactory Plugin <Artifactory+Plugin>`
|
:jenkins-wiki:`Artifactory Plugin <Artifactory+Plugin>`
|
||||||
@ -2065,7 +2064,7 @@ def artifactory_maven(parser, xml_parent, data):
|
|||||||
'release-repo-key', '')
|
'release-repo-key', '')
|
||||||
|
|
||||||
|
|
||||||
def artifactory_generic(parser, xml_parent, data):
|
def artifactory_generic(registry, xml_parent, data):
|
||||||
"""yaml: artifactory-generic
|
"""yaml: artifactory-generic
|
||||||
Wrapper for non-Maven projects. Requires the
|
Wrapper for non-Maven projects. Requires the
|
||||||
:jenkins-wiki:`Artifactory Plugin <Artifactory+Plugin>`
|
:jenkins-wiki:`Artifactory Plugin <Artifactory+Plugin>`
|
||||||
@ -2124,7 +2123,7 @@ def artifactory_generic(parser, xml_parent, data):
|
|||||||
artifactory_common_details(details, data)
|
artifactory_common_details(details, data)
|
||||||
|
|
||||||
# Get plugin information to maintain backwards compatibility
|
# Get plugin information to maintain backwards compatibility
|
||||||
info = parser.registry.get_plugin_info('artifactory')
|
info = registry.get_plugin_info('artifactory')
|
||||||
version = pkg_resources.parse_version(info.get('version', '0'))
|
version = pkg_resources.parse_version(info.get('version', '0'))
|
||||||
|
|
||||||
if version >= pkg_resources.parse_version('2.3.0'):
|
if version >= pkg_resources.parse_version('2.3.0'):
|
||||||
@ -2161,7 +2160,7 @@ def artifactory_generic(parser, xml_parent, data):
|
|||||||
artifactory_env_vars_patterns(artifactory, data)
|
artifactory_env_vars_patterns(artifactory, data)
|
||||||
|
|
||||||
|
|
||||||
def artifactory_maven_freestyle(parser, xml_parent, data):
|
def artifactory_maven_freestyle(registry, xml_parent, data):
|
||||||
"""yaml: artifactory-maven-freestyle
|
"""yaml: artifactory-maven-freestyle
|
||||||
Wrapper for Free Stype projects. Requires the Artifactory plugin.
|
Wrapper for Free Stype projects. Requires the Artifactory plugin.
|
||||||
Requires :jenkins-wiki:`Artifactory Plugin <Artifactory+Plugin>`
|
Requires :jenkins-wiki:`Artifactory Plugin <Artifactory+Plugin>`
|
||||||
@ -2305,7 +2304,7 @@ def artifactory_maven_freestyle(parser, xml_parent, data):
|
|||||||
artifactory_optional_props(artifactory, data, 'wrappers')
|
artifactory_optional_props(artifactory, data, 'wrappers')
|
||||||
|
|
||||||
|
|
||||||
def maven_release(parser, xml_parent, data):
|
def maven_release(registry, xml_parent, data):
|
||||||
"""yaml: maven-release
|
"""yaml: maven-release
|
||||||
Wrapper for Maven projects
|
Wrapper for Maven projects
|
||||||
Requires :jenkins-wiki:`M2 Release Plugin <M2+Release+Plugin>`
|
Requires :jenkins-wiki:`M2 Release Plugin <M2+Release+Plugin>`
|
||||||
@ -2357,8 +2356,8 @@ class Wrappers(jenkins_jobs.modules.base.Base):
|
|||||||
component_type = 'wrapper'
|
component_type = 'wrapper'
|
||||||
component_list_type = 'wrappers'
|
component_list_type = 'wrappers'
|
||||||
|
|
||||||
def gen_xml(self, parser, xml_parent, data):
|
def gen_xml(self, xml_parent, data):
|
||||||
wrappers = XML.SubElement(xml_parent, 'buildWrappers')
|
wrappers = XML.SubElement(xml_parent, 'buildWrappers')
|
||||||
|
|
||||||
for wrap in data.get('wrappers', []):
|
for wrap in data.get('wrappers', []):
|
||||||
self.registry.dispatch('wrapper', parser, wrappers, wrap)
|
self.registry.dispatch('wrapper', wrappers, wrap)
|
||||||
|
@ -27,7 +27,6 @@ from jenkins_jobs.constants import MAGIC_MANAGE_STRING
|
|||||||
from jenkins_jobs.errors import JenkinsJobsException
|
from jenkins_jobs.errors import JenkinsJobsException
|
||||||
from jenkins_jobs.formatter import deep_format
|
from jenkins_jobs.formatter import deep_format
|
||||||
import jenkins_jobs.local_yaml as local_yaml
|
import jenkins_jobs.local_yaml as local_yaml
|
||||||
from jenkins_jobs.registry import ModuleRegistry
|
|
||||||
from jenkins_jobs import utils
|
from jenkins_jobs import utils
|
||||||
from jenkins_jobs.xml_config import XmlJob
|
from jenkins_jobs.xml_config import XmlJob
|
||||||
|
|
||||||
@ -71,7 +70,7 @@ def combination_matches(combination, match_combinations):
|
|||||||
|
|
||||||
|
|
||||||
class YamlParser(object):
|
class YamlParser(object):
|
||||||
def __init__(self, jjb_config=None, plugins_info=None):
|
def __init__(self, jjb_config=None):
|
||||||
self.data = {}
|
self.data = {}
|
||||||
self.jobs = []
|
self.jobs = []
|
||||||
self.xml_jobs = []
|
self.xml_jobs = []
|
||||||
@ -80,9 +79,6 @@ class YamlParser(object):
|
|||||||
self.keep_desc = jjb_config.yamlparser['keep_descriptions']
|
self.keep_desc = jjb_config.yamlparser['keep_descriptions']
|
||||||
self.path = jjb_config.yamlparser['include_path']
|
self.path = jjb_config.yamlparser['include_path']
|
||||||
|
|
||||||
self.registry = ModuleRegistry(jjb_config,
|
|
||||||
plugins_info)
|
|
||||||
|
|
||||||
def load_files(self, fn):
|
def load_files(self, fn):
|
||||||
|
|
||||||
# handle deprecated behavior, and check that it's not a file like
|
# handle deprecated behavior, and check that it's not a file like
|
||||||
@ -220,11 +216,11 @@ class YamlParser(object):
|
|||||||
job["description"] = description + \
|
job["description"] = description + \
|
||||||
self._get_managed_string().lstrip()
|
self._get_managed_string().lstrip()
|
||||||
|
|
||||||
def expandYaml(self, jobs_glob=None):
|
def expandYaml(self, registry, jobs_glob=None):
|
||||||
changed = True
|
changed = True
|
||||||
while changed:
|
while changed:
|
||||||
changed = False
|
changed = False
|
||||||
for module in self.registry.modules:
|
for module in registry.modules:
|
||||||
if hasattr(module, 'handle_data'):
|
if hasattr(module, 'handle_data'):
|
||||||
if module.handle_data(self.data):
|
if module.handle_data(self.data):
|
||||||
changed = True
|
changed = True
|
||||||
@ -372,23 +368,23 @@ class YamlParser(object):
|
|||||||
# project does not otherwise have a description.
|
# project does not otherwise have a description.
|
||||||
return "\n\n" + MAGIC_MANAGE_STRING
|
return "\n\n" + MAGIC_MANAGE_STRING
|
||||||
|
|
||||||
def generateXML(self):
|
def generateXML(self, registry):
|
||||||
for job in self.jobs:
|
for job in self.jobs:
|
||||||
self.xml_jobs.append(self.getXMLForJob(job))
|
self.xml_jobs.append(self.getXMLForJob(job, registry))
|
||||||
|
|
||||||
def getXMLForJob(self, data):
|
def getXMLForJob(self, data, registry):
|
||||||
kind = data.get('project-type', 'freestyle')
|
kind = data.get('project-type', 'freestyle')
|
||||||
|
|
||||||
for ep in pkg_resources.iter_entry_points(
|
for ep in pkg_resources.iter_entry_points(
|
||||||
group='jenkins_jobs.projects', name=kind):
|
group='jenkins_jobs.projects', name=kind):
|
||||||
Mod = ep.load()
|
Mod = ep.load()
|
||||||
mod = Mod(self.registry)
|
mod = Mod(registry)
|
||||||
xml = mod.root_xml(data)
|
xml = mod.root_xml(data)
|
||||||
self.gen_xml(xml, data)
|
self.gen_xml(xml, data, registry)
|
||||||
job = XmlJob(xml, data['name'])
|
job = XmlJob(xml, data['name'])
|
||||||
return job
|
return job
|
||||||
|
|
||||||
def gen_xml(self, xml, data):
|
def gen_xml(self, xml, data, registry):
|
||||||
for module in self.registry.modules:
|
for module in registry.modules:
|
||||||
if hasattr(module, 'gen_xml'):
|
if hasattr(module, 'gen_xml'):
|
||||||
module.gen_xml(self, xml, data)
|
module.gen_xml(xml, data)
|
||||||
|
@ -118,8 +118,14 @@ class ModuleRegistry(object):
|
|||||||
def getHandler(self, category, name):
|
def getHandler(self, category, name):
|
||||||
return self.handlers[category][name]
|
return self.handlers[category][name]
|
||||||
|
|
||||||
def dispatch(self, component_type,
|
@property
|
||||||
parser, xml_parent,
|
def parser_data(self):
|
||||||
|
return self.__parser_data
|
||||||
|
|
||||||
|
def set_parser_data(self, parser_data):
|
||||||
|
self.__parser_data = parser_data
|
||||||
|
|
||||||
|
def dispatch(self, component_type, xml_parent,
|
||||||
component, template_data={}):
|
component, template_data={}):
|
||||||
"""This is a method that you can call from your implementation of
|
"""This is a method that you can call from your implementation of
|
||||||
Base.gen_xml or component. It allows modules to define a type
|
Base.gen_xml or component. It allows modules to define a type
|
||||||
@ -219,7 +225,7 @@ class ModuleRegistry(object):
|
|||||||
component_list_type, eps)
|
component_list_type, eps)
|
||||||
|
|
||||||
# check for macro first
|
# check for macro first
|
||||||
component = parser.data.get(component_type, {}).get(name)
|
component = self.parser_data.get(component_type, {}).get(name)
|
||||||
if component:
|
if component:
|
||||||
if name in eps and name not in self.masked_warned:
|
if name in eps and name not in self.masked_warned:
|
||||||
# Warn only once for each macro
|
# Warn only once for each macro
|
||||||
@ -232,11 +238,10 @@ class ModuleRegistry(object):
|
|||||||
# Pass component_data in as template data to this function
|
# Pass component_data in as template data to this function
|
||||||
# so that if the macro is invoked with arguments,
|
# so that if the macro is invoked with arguments,
|
||||||
# the arguments are interpolated into the real defn.
|
# the arguments are interpolated into the real defn.
|
||||||
self.dispatch(component_type,
|
self.dispatch(component_type, xml_parent, b, component_data)
|
||||||
parser, xml_parent, b, component_data)
|
|
||||||
elif name in eps:
|
elif name in eps:
|
||||||
func = eps[name].load()
|
func = eps[name].load()
|
||||||
func(parser, xml_parent, component_data)
|
func(self, xml_parent, component_data)
|
||||||
else:
|
else:
|
||||||
raise JenkinsJobsException("Unknown entry point or macro '{0}' "
|
raise JenkinsJobsException("Unknown entry point or macro '{0}' "
|
||||||
"for component type: '{1}'.".
|
"for component type: '{1}'.".
|
||||||
|
@ -40,6 +40,7 @@ from jenkins_jobs.modules import project_matrix
|
|||||||
from jenkins_jobs.modules import project_maven
|
from jenkins_jobs.modules import project_maven
|
||||||
from jenkins_jobs.modules import project_multijob
|
from jenkins_jobs.modules import project_multijob
|
||||||
from jenkins_jobs.parser import YamlParser
|
from jenkins_jobs.parser import YamlParser
|
||||||
|
from jenkins_jobs.registry import ModuleRegistry
|
||||||
from jenkins_jobs.xml_config import XmlJob
|
from jenkins_jobs.xml_config import XmlJob
|
||||||
|
|
||||||
# This dance deals with the fact that we want unittest.mock if
|
# This dance deals with the fact that we want unittest.mock if
|
||||||
@ -152,22 +153,24 @@ class BaseTestCase(LoggingFixture):
|
|||||||
self.addDetail("plugins-info",
|
self.addDetail("plugins-info",
|
||||||
text_content(str(plugins_info)))
|
text_content(str(plugins_info)))
|
||||||
|
|
||||||
parser = YamlParser(jjb_config, plugins_info)
|
parser = YamlParser(jjb_config)
|
||||||
|
registry = ModuleRegistry(jjb_config, plugins_info)
|
||||||
|
registry.set_parser_data(parser.data)
|
||||||
|
|
||||||
pub = self.klass(parser.registry)
|
pub = self.klass(registry)
|
||||||
|
|
||||||
project = None
|
project = None
|
||||||
if ('project-type' in yaml_content):
|
if ('project-type' in yaml_content):
|
||||||
if (yaml_content['project-type'] == "maven"):
|
if (yaml_content['project-type'] == "maven"):
|
||||||
project = project_maven.Maven(parser.registry)
|
project = project_maven.Maven(registry)
|
||||||
elif (yaml_content['project-type'] == "matrix"):
|
elif (yaml_content['project-type'] == "matrix"):
|
||||||
project = project_matrix.Matrix(parser.registry)
|
project = project_matrix.Matrix(registry)
|
||||||
elif (yaml_content['project-type'] == "flow"):
|
elif (yaml_content['project-type'] == "flow"):
|
||||||
project = project_flow.Flow(parser.registry)
|
project = project_flow.Flow(registry)
|
||||||
elif (yaml_content['project-type'] == "multijob"):
|
elif (yaml_content['project-type'] == "multijob"):
|
||||||
project = project_multijob.MultiJob(parser.registry)
|
project = project_multijob.MultiJob(registry)
|
||||||
elif (yaml_content['project-type'] == "externaljob"):
|
elif (yaml_content['project-type'] == "externaljob"):
|
||||||
project = project_externaljob.ExternalJob(parser.registry)
|
project = project_externaljob.ExternalJob(registry)
|
||||||
|
|
||||||
if project:
|
if project:
|
||||||
xml_project = project.root_xml(yaml_content)
|
xml_project = project.root_xml(yaml_content)
|
||||||
@ -175,7 +178,7 @@ class BaseTestCase(LoggingFixture):
|
|||||||
xml_project = XML.Element('project')
|
xml_project = XML.Element('project')
|
||||||
|
|
||||||
# Generate the XML tree directly with modules/general
|
# Generate the XML tree directly with modules/general
|
||||||
pub.gen_xml(parser, xml_project, yaml_content)
|
pub.gen_xml(xml_project, yaml_content)
|
||||||
|
|
||||||
# Prettify generated XML
|
# Prettify generated XML
|
||||||
pretty_xml = XmlJob(xml_project, 'fixturejob').output().decode('utf-8')
|
pretty_xml = XmlJob(xml_project, 'fixturejob').output().decode('utf-8')
|
||||||
@ -197,9 +200,11 @@ class SingleJobTestCase(BaseTestCase):
|
|||||||
parser = YamlParser(config)
|
parser = YamlParser(config)
|
||||||
parser.parse(self.in_filename)
|
parser.parse(self.in_filename)
|
||||||
|
|
||||||
|
registry = ModuleRegistry(config)
|
||||||
|
registry.set_parser_data(parser.data)
|
||||||
# Generate the XML tree
|
# Generate the XML tree
|
||||||
parser.expandYaml()
|
parser.expandYaml(registry)
|
||||||
parser.generateXML()
|
parser.generateXML(registry)
|
||||||
|
|
||||||
parser.xml_jobs.sort(key=operator.attrgetter('name'))
|
parser.xml_jobs.sort(key=operator.attrgetter('name'))
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ class TestTests(CmdTestsBase):
|
|||||||
self.assertIn("'ascii' codec can't encode character", str(e))
|
self.assertIn("'ascii' codec can't encode character", str(e))
|
||||||
|
|
||||||
@mock.patch('jenkins_jobs.cli.subcommand.update.YamlParser.generateXML')
|
@mock.patch('jenkins_jobs.cli.subcommand.update.YamlParser.generateXML')
|
||||||
@mock.patch('jenkins_jobs.parser.ModuleRegistry')
|
@mock.patch('jenkins_jobs.cli.subcommand.update.ModuleRegistry')
|
||||||
def test_plugins_info_stub_option(self, registry_mock, generateXML_mock):
|
def test_plugins_info_stub_option(self, registry_mock, generateXML_mock):
|
||||||
"""
|
"""
|
||||||
Test handling of plugins_info stub option.
|
Test handling of plugins_info stub option.
|
||||||
@ -155,7 +155,7 @@ class TestTests(CmdTestsBase):
|
|||||||
plugins_info_list)
|
plugins_info_list)
|
||||||
|
|
||||||
@mock.patch('jenkins_jobs.cli.subcommand.update.YamlParser.generateXML')
|
@mock.patch('jenkins_jobs.cli.subcommand.update.YamlParser.generateXML')
|
||||||
@mock.patch('jenkins_jobs.parser.ModuleRegistry')
|
@mock.patch('jenkins_jobs.cli.subcommand.update.ModuleRegistry')
|
||||||
def test_bogus_plugins_info_stub_option(self, registry_mock,
|
def test_bogus_plugins_info_stub_option(self, registry_mock,
|
||||||
generateXML_mock):
|
generateXML_mock):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user