I was afraid that this would be the answer... Anyway, I guess this is not the right approach to solve the problem. Maybe a better way would be to add my property fields to the job labels and create new label (Label field AND ClustersJobProperty fields) so the node provisioning mechanism is aware of all provisioning info.
Now the question is how to add the ClustersJobProperty fields to the Job label. Time for another research... Thanks, Yoram On Thursday, August 7, 2014 5:36:09 PM UTC+3, Jesse Glick wrote: > > On Mon, Aug 4, 2014 at 5:40 AM, <[email protected] <javascript:>> > wrote: > > After reading some more, I think I can simplify my question. > > Ah, if only every message started this way! :-) > > > I have a class that extends Cloud and overrides Cloud.canProvision and > Cloud.provision. > > Inside my implementation of canProvision and/or provision I want to > access some information on the build and the job that triggered the call to > Cloud.canProvision/provision. > > I do not think that information is available at this point. Jenkins > decides to ask clouds to provision new slaves based on various load > statistics regarding labels needed, not necessarily by a single queue > item. However you can go through > Queue.getInstance().getBuildableItems(), checking whether item.task > instanceof Job, and if so check if the Job has your property, etc. > > > I've tried System.getEnv("JOB_NAME") but got null. > > Sure, this would never be set inside the Jenkins process, only in some > process forked by a slave agent once a build starts. > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
