2016-12-23 10 views
0
以下

私は動的に新しいパイプラインビューを追加したいセクション「セクションをリストビュー」ジョブ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> 

ための断面図でプラグインのconfig.xmlですこのconfig.xmlに「pipeline3」という名前を付けて、同じものに対してJob 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

関連する問題