2016-12-23 52 views
0

下面是我要動態地添加新的管道視圖剖視圖插件的config.xml的部分「查看清單節」追加新的管道來「觀察上市節」使用工作DSL - 詹金斯

<hudson.plugins.sectioned__view.SectionedView plugin="[email protected]"> 
    <owner class="hudson" reference="../../.."/> 
    <name>pipeline view</name> 
    <filterExecutors>false</filterExecutors> 
    <filterQueue>false</filterQueue> 
    <properties class="hudson.model.View$PropertyList"/> 
    <sections> 
    <hudson.plugins.sectioned__view.ViewListingSection> 
     <jobNames> 
     <comparator class="hudson.util.CaseInsensitiveComparator"/> 
     </jobNames> 
     <jobFilters/> 
     <name></name> 
     <width>FULL</width> 
     <alignment>CENTER</alignment> 
     <views> 
     <string>pipeline1</string> 
     <string>pipeline2</string> 
     </views> 
     <columns>1</columns> 
    </hudson.plugins.sectioned__view.ViewListingSection> 
    </sections> 
</hudson.plugins.sectioned__view.SectionedView> 

名爲「pipeline3」到這個config.xml,我使用的是同樣的作業DSL。以下是我嘗試過的代碼。

sectionedView('pipeline view') { 
    configure { node -> 
node/sections/'hudson.plugins.sectioned__view.ViewListingSection'/ 'views'/string('pipeline3') 
    } 
} 

上面的代碼覆蓋了整個xml配置,而不是隻追加一個新值。

您能否爲我推薦一個解決方案?謝謝

回答

0

作業DSL只能生成一個完整的視圖配置。它無法更新視圖的某些部分。您需要在Job DSL中定義完整的視圖配置。

+0

謝謝您的回覆!有沒有辦法使用現有的視圖來更新配置,例如在作業的情況下,可以使用job('job1'){using('job1')configure {.....}}來更新作業' – shwetha