1

For a given Hudson job, which is parameterized, I'd like to see a list of recent builds with the parameters displayed. I don't want to have to do any extra clicks to drill down, because I need to visually scan the jobs to find the parameter values I'm looking for.

For example, in the dashboard below, there are a bunch of job runs showing, but if I want to know which parameters were set for each job, I need to click them one by one, until I find the one I'm looking for.

I'd be happy if there was a groovy script I could run to accomplish the same thing, ie show something like

1283 April 23,2015 12:09:47 PM param1=foo param2=bar param3=122

1282 April 23,2015 12:08:47 PM param1=baz param2=goo param3=100

...

enter image description here

egilchri
  • 761
  • 1
  • 5
  • 19

1 Answers1

1

Here I go again, answering my own question. This is a rough approximation, but it's on the right track. I wrote a little Groovy script:

def item = hudson.model.Hudson.instance.getItem("Rsync library to docs-stage") 

def last_build = item.getLastBuild()
end_range = last_build.getNumber()
start_range = end_range - 50

printf ("Date\tCUSTOM_TOP\tPARTNO_ALIAS\tjob\n")
for ( i in start_range..end_range ) {
    build1= item.getNearestBuild(i)
    printf ("%s, CUSTOM_TOP: %s \tPARTNO_ALIAS: %s \tjob: %s \n",  build1.getTime() , build1.buildVariableResolver.resolve("CUSTOM_TOP"), build1.buildVariableResolver.resolve("PARTNO_ALIAS"), i)

}
egilchri
  • 761
  • 1
  • 5
  • 19