【问题标题】:Jenkins job DSL list view does not create a jobJenkins 作业 DSL 列表视图不创建作业
【发布时间】:2018-07-02 15:10:51
【问题描述】:

下面的作业 DSL 创建了一个新作业,列表视图,应该将新作业添加到视图中,但它不会将作业添加到视图中 - 作业运行时没有任何错误:

multibranchPipelineJob("myjob") {
  branchSources {
    branchSource {
      source {
        bitbucket {
          credentialsId('bitbucket-login-user-pass')
          repoOwner('myteam')
          repository('myrepo')
          autoRegisterHook(true)
        }
      }
    }
  }
}
//listview is created, but job not added to it
listView('mylistview') {
  jobs {
    name('myjob')
  }
}

我怀疑我在做一些愚蠢的事情。一切都已创建,但是当我单击“mylistview”选项卡时,“myjob”不存在。

【问题讨论】:

    标签: jenkins jenkins-plugins jenkins-job-dsl


    【解决方案1】:

    我现在感觉很笨,但这种行为有点奇怪。看起来您需要向视图中添加列,否则您将看不到任何内容!

    How to put jobs inside a folder in jenkins?

    listView('MyJobsList') {
      jobs {
         map.each{
           name((it.key).trim())
         }
      }
       columns{
            status()
            weather()
            name()
            lastSuccess()
            lastFailure()
            lastDuration()
            buildButton()
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-17
      • 2014-08-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多