Jenkins DSL for ci-skip插件

时间:2016-11-16 14:39:16

标签: jenkins groovy jenkins-job-dsl

我正在尝试在Jenkins DSL作业中配置ci-skip plugin

由于不支持此插件,我编写了此配置块:

mavenJob("testproject") {
  #...
  wrappers {
    configure { node ->
      node / 'buildWrappers' / 'ruby-proxy-object' / 'ruby-object'(['ruby-class': 'Jenkins::Tasks::BuildWrapperProxy', 'pluginid': 'ci-skip']) {
        'object'(['ruby-class': 'CiSkipWrapper', 'pluginid': 'ci-skip']) {
          'ci__skip'(['ruby-class': 'NilClass', 'pluginid': 'ci-skip'])
        }
        'pluginid'([pluginid: 'ci-skip', 'ruby-class': 'String'], 'ci-skip')
      }
    }
  }
}

这正确地生成了XML:

<buildWrappers>
    <ruby-proxy-object>
        <ruby-object ruby-class="Jenkins::Tasks::BuildWrapperProxy" pluginid="ci-skip">
            <object ruby-class="CiSkipWrapper" pluginid="ci-skip">
                <ci__skip ruby-class="NilClass" pluginid="ci-skip"/>
            </object>
            <pluginid ruby-class="String" pluginid="ci-skip">ci-skip</pluginid>
        </ruby-object>
    </ruby-proxy-object>
</buildWrappers>

但最终,该插件未启用...未选中“启用ci-skip”的“构建环境”中的复选框。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

此处记录了类似的问题:https://issues.jenkins-ci.org/browse/JENKINS-38145

从Ruby Runtime Plugin 0.13降级到0.12解决了这个问题!