On Mon, Aug 4, 2014 at 5:40 AM, <[email protected]> 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.