public interface JenkinsJobInfoPlugin extends ModulePlugin
This plugin is used by SetupJenkinsJobs from dragom-core. SetupJenkinsJobs takes care of interacting with Jenkins for creating jobs (and folders). It takes care of the Jenkins base URL and credentials. It manages persisting the items that are created so that jobs can be created and updated across multiple invocations while maintaining a common context. These are considered common services which do not need to be abstracted.
This plugin takes care of providing the information about a Jenkins job to SetupJenkinsJobs, such as the job's full name and its configuration data. These are specific to each situation and need to be abstracted into a plugin.
Jenkins jobs can often be created in different contexts. If this is the case, then it is up to the implementations of this plugin to support that such a context be specified externally, such as with a runtime property, and that different parameters be associated with the various contexts.
| Modifier and Type | Method and Description |
|---|---|
String |
getJobFullName(Version versionDynamic)
Returns the full name of the job.
|
Map<String,String> |
getMapTemplateParam(ReferenceGraph referenceGraph,
Version version)
Returns a Map of the parameters to use with the template returned by
getTemplate() to create a job. |
Reader |
getReaderConfig(ReferenceGraph referenceGraph,
Version version)
Returns a Reader from which the XML configuration of the job to be created can
be read.
|
String |
getTemplate()
Returns the full name of the template to use for creating the job, as in
TopFolder/SubFolder/template.
|
boolean |
isHandleParentFolderCreation() |
getModulegetNodeString getJobFullName(Version versionDynamic)
This is used by SetupJenkinsJobs from dragom-core to know which job to create.
It can also be used by implementations themselves of this plugin to obtain the
downstream jobs that handle building Module's which depend on the
current Module so that the configuration of the latter can, if appropriate,
contain these references.
versionDynamic - Dynamic Version of the ModuleVersion for which a job must
be created. A ModuleVersion is not passed as a parameter since the
NodePath in the ModuleVersion would be redundant with the NodePath of
the Module to which the instance of this plugin is associated.boolean isHandleParentFolderCreation()
getJobFullName(org.azyva.dragom.model.Version) is not static, is specific to some projects and could
not exist and need to be created.String getTemplate()
null is returned to indicate that the job must be created as a regular non-templatized job.
If null is not returned, getMapTemplateParam(org.azyva.dragom.reference.ReferenceGraph, org.azyva.dragom.model.Version) is expected to be called to
obtain the template parameters.
If null is returned, getReaderConfig(org.azyva.dragom.reference.ReferenceGraph, org.azyva.dragom.model.Version) is expected to be called to
obtain the complete job configuration.
Map<String,String> getMapTemplateParam(ReferenceGraph referenceGraph, Version version)
getTemplate() to create a job.
If getTemplate returns null, this method will not be called.
referenceGraph - ReferenceGraph which contains the ModuleVersion
for which a job must be created.version - Version of the ModuleVersion for which a job must be created. A
ModuleVersion is not passed as a parameter since the NodePath in the
ModuleVersion would be redundant with the NodePath of the Module to
which the instance of this plugin is associated.Reader getReaderConfig(ReferenceGraph referenceGraph, Version version)
If getTemplate() does not return null, this method will not be called.
Providing the XML configuration as a Reader seems to be the most flexible way to return it, and allow the implementation to have control over the efficiency in handling the XML data.
referenceGraph - ReferenceGraph which contains the ModuleVersion
for which a job must be created.version - Version of the ModuleVersion for which a job must be created. A
ModuleVersion is not passed as a parameter since the NodePath in the
ModuleVersion would be redundant with the NodePath of the Module to
which the instance of this plugin is associated.Copyright © 2015–2017 AZYVA INC.. All rights reserved.