Support for Inheritance Plugin

24 visualitzacions
Ves al primer missatge no llegit

pssp

no llegida,
1 de març 2018, 9:28:031/3/18
a job-dsl-plugin
Hi.

DSL does not support Inheritance plugin iirc. Do You plan to add support for that plugin?

pssp.

Victor Martinez

no llegida,
1 de març 2018, 9:59:161/3/18
a job-dsl-plugin
As far as I see it's supported based on the Dynamic-DSL

- <YOUR_JENKINS_URL>/plugin/job-dsl/api-viewer/index.html#plugin/project-inheritance

Cheers

pssp

no llegida,
1 de març 2018, 10:53:471/3/18
a job-dsl-plugin
OK, I did not see that dynamic DSL, thanks!

But for now I there see only inheritableStringParameterDefinition and inheritableStringParameterReferenceDefinition and nothing more. After some research I cannot find usages of DSL + Plugin Inheritance. On the other hand, probably jobs inheritance may be omitted, but it would be easy to see full project structure. Maybe I should try to move all thing to ie. pipeline.

Have You tried something like this? Do You have any examples? If so, I would be grateful.

pssp.

pssp

no llegida,
1 de març 2018, 15:12:421/3/18
a job-dsl-plugin
OK, in all - there is an answer fo my question somewhere in wiki. Example:

job('dsl-parent') {
  configure
{ project ->
    project
.name = 'hudson.plugins.project__inheritance.projects.InheritanceProject'
 
}
  parameters
{
    inheritableStringParameterDefinition
{
      name
('name')
      defaultValue
('val')
      description
('desc')
      inheritanceMode
('OVERWRITABLE')
      mustHaveDefaultValue
(true)
      mustBeAssigned
(false)
      whitespaceMode
('TRIM')
      isHidden
(true)
   
}
 
}
  steps
{
    shell
('echo ${name}')
 
}
}

job
('dsl-child') {
  configure
{ project ->
    project
.name = 'hudson.plugins.project__inheritance.projects.InheritanceProject'
 
}
  configure
{ node ->
    node
/ 'parentReferences' / 'hudson.plugins.project__inheritance.projects.references.SimpleProjectReference' / name('dsl-parent')
 
}
  parameters
{
    inheritableStringParameterReferenceDefinition
{
      name
('name')
      defaultValue
('new-val')
   
}
 
}
}


I do not know if it is proposed solution, but it works.

pssp.

Respon a tots
Respon a l'autor
Reenvia
0 missatges nous