Jenkins Pipeline / Job DSL Problem

20 views
Skip to first unread message

khmarbaise

unread,
Jan 2, 2018, 8:50:12 AM1/2/18
to Jenkins Users
Hi,
I currently have a simple Pipeline Script which looks more or less like this (reduced to the important parts)

node {
  stage
('First') {
   
// Creating a list of names names = [ "a", "b", "c" ]
   
Job.create(this, names)
 
}
}




Furthermore I have create a global pipeline lib which contains the class Job like this:

class Job {
 
static final void create (def context, def names) {
    names
.each { name ->
      context
.jobDsl scriptText: "job('" + name + "')"

   
}
 
}

}

Unfortunately this fails all the time that the script needed to be approved by the administrator. Based on the documentation I had expected that I can simply run that...cause the global lib in Jenkins will be trusted by default...

Or do I need to go another path to create jobs from a Pipeline script ? 

Kind regards
Karl Heinz Marbaise
Reply all
Reply to author
Forward
0 new messages