Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Set Slave ToolInstallation path with groovy cli script
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Matt Gollob  
View profile  
 More options Nov 7 2012, 3:42 pm
From: Matt Gollob <mattgol...@gmail.com>
Date: Wed, 7 Nov 2012 12:42:54 -0800 (PST)
Local: Wed, Nov 7 2012 3:42 pm
Subject: Set Slave ToolInstallation path with groovy cli script

Hello everyone,

I'm looking for help with writing a groovy script for use with jenkins-cli
that can set the ToolInstallation path for a particular slave and tool.
 In https://wiki.jenkins-ci.org/display/JENKINS/Display+Tools+Location+on...
I see how I can enumerate all the tools and their installations.  However,
not being a Java developer, I'm having trouble figuring out what the
inverse of ToolInstallation.translateFor() might be.

First off, is it possible to set the tool path for a slave from a
cli/groovy script?  If so, can someone point me in the right direction for
how I might set (and save) a new path?

Thanks a lot,
Matt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jesse Glick  
View profile  
 More options Nov 7 2012, 7:22 pm
From: Jesse Glick <jgl...@cloudbees.com>
Date: Wed, 07 Nov 2012 19:22:20 -0500
Local: Wed, Nov 7 2012 7:22 pm
Subject: Re: Set Slave ToolInstallation path with groovy cli script
On 11/07/2012 03:42 PM, Matt Gollob wrote:

> I'm having trouble figuring out what the inverse of ToolInstallation.translateFor() might be

Hint: hudson.tools.ToolLocationNodeProperty

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Gollob  
View profile  
 More options Nov 12 2012, 10:43 am
From: Matt Gollob <mattgol...@gmail.com>
Date: Mon, 12 Nov 2012 07:43:20 -0800 (PST)
Local: Mon, Nov 12 2012 10:43 am
Subject: Re: Set Slave ToolInstallation path with groovy cli script

I'm sorry, but I need a little more explicit direction.  I found the source
for ToolLocationNodeProperty, but the class has no setters, so am I
supposed to create a new instance?  I don't want to add a location, I want
to change the one that's already there, so a new instance doesn't seem like
the right thing to do.

Even if I have a new instance, I have to set that on something, but the
Slave class doesn't seem to have a setter for the properties collection
either, so I'm at loss as to how to get my new instance into the Slave's
property collection.  Also, I don't quite grok the relationship between a
property and a descriptor.  They seem to both point to collections of each
other, and neither has a setter for home so no help there in trying to
figure out which one I'm supposed to be dealing with.

I also found NodeProperty.reconfigure(), but have no idea what a
StaplerRequest is or where I'd get one from, nor do have the JSONObject
that I assume represents the configuration.  Is this the route I should be
heading down?  I think this might actually be intended for use by the web
UI and not CLI/Groovy.  How can I get the JSON for the current
configuration for the slave so I can figure out which part to modify?

What would be most helpful is a block of code (even pseudo-code would help)
outlining what I need to do to set the path to the tool.

Sorry to be such a newbie about this, but there's some connection between
all these types that I'm just not seeing.

Thanks for the help,
Matt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jesse Glick  
View profile  
 More options Nov 12 2012, 11:25 am
From: Jesse Glick <jgl...@cloudbees.com>
Date: Mon, 12 Nov 2012 11:25:39 -0500
Local: Mon, Nov 12 2012 11:25 am
Subject: Re: Set Slave ToolInstallation path with groovy cli script
On 11/12/2012 10:43 AM, Matt Gollob wrote:

> I need a little more explicit direction.

Sorry, no time to help more; maybe someone else can chime in.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »