1

我正在尝试通过使用两个正则表达式作业过滤器的 jjb 创建一个视图。regex-job 是一个字典,但我无法理解语法。到目前为止已经尝试过类似的东西

- view:
    name: 'viewname'
    view-type: 'list'
    regex: 'regexfromoutsidejobfilterblock'
    job-filters:
      - regex-job:
          - regex: 'regex1'
            match-type: 'excludeMatched'
            regex-name: 'one'
          - regex: 'regex2'
            match-type: 'includeMatched'
            regex-name: 'two'
      - job-status:
          disabled: true
          match-type: 'excludeMatched'

它返回一个损坏的 xml


 + <?xml version="1.0" encoding="utf-8"?>
 + <hudson.model.ListView>
 +   <name>viewname</name>
 +   <description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
 +   <filterExecutors>false</filterExecutors>
 +   <filterQueue>false</filterQueue>
 +   <properties class="hudson.model.View$PropertyList"/>
 +   <jobNames>
 +     <comparator class="hudson.util.CaseInsensitiveComparator"/>
 +   </jobNames>
 +   <jobFilters/>
 +   <columns>
 +     <hudson.views.StatusColumn/>
 +     <hudson.views.WeatherColumn/>
 +     <hudson.views.JobColumn/>
 +     <hudson.views.LastSuccessColumn/>
 +     <hudson.views.LastFailureColumn/>
 +     <hudson.views.LastDurationColumn/>
 +     <hudson.views.BuildButtonColumn/>
 +   </columns>
 +   <includeRegex>regexfromoutsidejobfilterblock</includeRegex>
 +   <recurse>false</recurse>
 + </hudson.model.ListView> 

和类似的东西

job-filters:
      regex-job:
          regex: 'regex1'
          regex-name: 'one'
          match-type: 'excludeMatched'
      regex-job:
          regex: 'regex2'
          regex-name: 'two'
          match-type: 'includeMatched'
      job-status:
          disabled: true
          match-type: 'excludeMatched'

只需使用第二个正则表达式覆盖第一个。

先感谢您

4

0 回答 0