[英]Append new pipeline to 'view listing sections' using Job DSL - Jenkins
以下是“視圖列表部分”部分的部分視圖插件的config.xml
<hudson.plugins.sectioned__view.SectionedView plugin="sectioned-view@1.20">
<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>
我想向此config.xml動態添加一個名稱為“ pipeline3”的新管道視圖,並且我正在使用Job DSL。 下面是我嘗試過的代碼。
sectionedView('pipeline view') {
configure { node ->
node / sections / 'hudson.plugins.sectioned__view.ViewListingSection'/ 'views' / string('pipeline3')
}
}
上面的代碼將覆蓋整個xml配置,而不是僅附加一個新值。
您能給我建議一個解決方案嗎? 謝謝
作業DSL只能生成完整的視圖配置。 它無法更新視圖的某些部分。 您需要在Job DSL中定義完整的視圖配置。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.