sectionedView containing multiple 'viewListingSections' inside sections ?

12 views
Skip to first unread message

Torsten Reinhard

unread,
Oct 17, 2016, 5:41:37 AM10/17/16
to job-dsl-plugin
Hi,

I want to generate a sectionedView, containing some "view Listing Sections" (Pipelines) like below:


<hudson.plugins.sectioned__view.SectionedView plugin="section...@1.19">
  <name>Pipelines</name>
 
<filterExecutors>false</filterExecutors>
 
<filterQueue>false</filterQueue>
 
<properties class="hudson.model.View$PropertyList"/>
 
<sections>
   
<hudson.plugins.sectioned__view.ViewListingSection>
      <name>CI Pipelines (trunk)</name>
      ...
      <views>
       
<string>CI-Pipelines$Apache-trunk-TEST3</string>
       
<string>CI-Pipelines$Backend-trunk-TEST3</string>
      </views>
     
<columns>1</columns>
   
</hudson.plugins.sectioned__view.ViewListingSection>
   
<hudson.plugins.sectioned__view.ViewListingSection>
      <name>Deploy Pipelines</name>
      ...
      <views>
       
<string>Deploy-Pipelines-INT1</string>
       
<string>Deploy-Pipelines-INT2</string>
      </views>
     
<columns>2</columns>
   
</hudson.plugins.sectioned__view.ViewListingSection>
    ...
   
</sections>

I couldn´t find a way to do this using the groovy DSL:

sectionedView('example') {
    configure
{ view->
        view
/ sections /
           
'hudson.plugins.sectioned__view.ViewListingSection(class:A)' {
           
}
        view
/ sections /
           
'hudson.plugins.sectioned__view.ViewListingSection(class:B)' {
       
}
   
}
}



works - but if I remove the (class:A/B)  there´s only one section generated, the other one is missing than.

Is there a way to workaround that? Currently, the DSL only supports "listView", so supporting "viewListings" would also be nice in one of the next versions.

Thanx for any help,

Torsten

Torsten Reinhard

unread,
Oct 17, 2016, 6:04:47 AM10/17/16
to job-dsl-plugin
found it here: http://www.devexp.eu/2014/10/26/use-unsupported-jenkins-plugins-with-jenkins-dsl/

I just missed the "<<" operator:

configure { view->
  view
/ sections << 'hudson.plugins.sectioned__view.ViewListingSection' {
 
}
  view
/ sections << 'hudson.plugins.sectioned__view.ViewListingSection' {
 
}
}
Reply all
Reply to author
Forward
0 new messages