Jenkins DSL Plugin: How to create work in existing jenkins view?

I found the following question regarding job creation and adding to a newly created view using the DSL plugin.

Adding a task to a newly created view.

How to add a created task to an existing view using the DSL plugin? I could not find a hint of documentation. Maybe it's too obvious that I don't see a solution?

Although I read that creating a view will cause re-creation if the view already exists. What does it mean for existing projects under this view?

Thank you for your help.

+3
source share
3 answers

, DSL . , DSL, , DSL.

, project-a, , project-b, DSL. , DSL, .

job('project-b') {
}

listView('project-view') {
  jobs {
    name('project-a')
    name('project-b')
  }
}

Jenkins API DSL script. , . , . DSL script.

DSL ( ), . . , . .

+5

daspilker, .

- >

: PLUG

DSL , DSL, .

  • regexp, DSL ( , DSL ) - → - > - > regexpJobFilter

  • regexp , DSL .

. DSL .

:

DSL (, )

, , DSL.

enter image description here

+2

- , @daspilker . ( ).

:

  • , DSL
  • ( ) DSL
  • , ,
  • , DSL.
  • check
  • DSL script, () , .

I just came up with this solution, remembering that I once deleted (overwritten) an existing task from the view by completing a DSL task with the same target name, but at least it remained in its original form :)

0
source

All Articles