相关疑难解决方法(0)

如何从排队的作业中检索构建参数?

我想编写一个系统groovy脚本来检查Jenkins中的排队作业,并提取作为计划作业时提供的构建参数(以及构建原因作为奖励).想法?

特别:

def q = Jenkins.instance.queue
q.items.each { println it.task.name }
Run Code Online (Sandbox Code Playgroud)

检索排队的项目.我不能为我的生活找出构建参数所在的位置.

我最接近的是:

def q = Jenkins.instance.queue
q.items.each { 
  println("${it.task.name}:")
  it.task.properties.each { key, val ->
    println("  ${key}=${val}")
  }
}
Run Code Online (Sandbox Code Playgroud)

这让我知道了:

4.1.next-build-launcher:
  com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty$ScannerJobPropertyDescriptor@b299407=com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty@5e04bfd7
  com.chikli.hudson.plugin.naginator.NaginatorOptOutProperty$DescriptorImpl@40d04eaa=com.chikli.hudson.plugin.naginator.NaginatorOptOutProperty@16b308db
  hudson.model.ParametersDefinitionProperty$DescriptorImpl@b744c43=hudson.mod el.ParametersDefinitionProperty@440a6d81
  ...
Run Code Online (Sandbox Code Playgroud)

groovy jenkins

2
推荐指数
1
解决办法
2387
查看次数

标签 统计

groovy ×1

jenkins ×1