public abstract class ToolInstaller extends Object implements Describable<ToolInstaller>, ExtensionPoint
ToolInstallation
in fact exists on a node.
The properties can be added to ToolInstallation
using the InstallSourceProperty
.
The subclass should have a ToolInstallerDescriptor
.
A config.jelly
should be provided to customize specific fields;
<t:label xmlns:t="/hudson/tools"/>
to customize label
.InstallSourceProperty
Modifier and Type | Class and Description |
---|---|
static class |
ToolInstaller.ToolInstallerEntry |
static class |
ToolInstaller.ToolInstallerList |
ExtensionPoint.LegacyInstancesAreScopedToHudson
Modifier and Type | Field and Description |
---|---|
protected ToolInstallation |
tool |
Modifier | Constructor and Description |
---|---|
protected |
ToolInstaller(String label)
Subclasses should pass these parameters in using
DataBoundConstructor . |
Modifier and Type | Method and Description |
---|---|
boolean |
appliesTo(Node node)
Checks whether this installer can be applied to a given node.
|
ToolInstallerDescriptor<?> |
getDescriptor()
Gets the descriptor for this instance.
|
String |
getLabel()
Label to limit which nodes this installation can be performed on.
|
abstract FilePath |
performInstallation(ToolInstallation tool,
Node node,
TaskListener log)
Ensure that the configured tool is really installed.
|
protected FilePath |
preferredLocation(ToolInstallation tool,
Node node)
Convenience method to find a location to install a tool.
|
protected void |
setTool(ToolInstallation t)
Called during the initialization to tell
ToolInstaller what ToolInstallation
it is configured against. |
protected transient ToolInstallation tool
protected ToolInstaller(String label)
DataBoundConstructor
.protected void setTool(ToolInstallation t)
ToolInstaller
what ToolInstallation
it is configured against.public final String getLabel()
public boolean appliesTo(Node node)
public abstract FilePath performInstallation(ToolInstallation tool, Node node, TaskListener log) throws IOException, InterruptedException
appliesTo(Node)
are true.tool
- the tool being installednode
- the computer on which to install the toollog
- any status messages produced by the installation go herepreferredLocation(hudson.tools.ToolInstallation, hudson.model.Node)
IOException
- if installation failsInterruptedException
- if communication with a agent is interruptedprotected final FilePath preferredLocation(ToolInstallation tool, Node node)
tool
- the tool being installednode
- the computer on which to install the toolToolInstallation.getHome()
if specified, else a path within the local
Jenkins work area named according to ToolInstallation.getName()
public ToolInstallerDescriptor<?> getDescriptor()
Describable
Descriptor
is a singleton for every concrete Describable
implementation, so if a.getClass() == b.getClass()
then by default
a.getDescriptor() == b.getDescriptor()
as well.
(In rare cases a single implementation class may be used for instances with distinct descriptors.)
getDescriptor
in interface Describable<ToolInstaller>
Copyright © 2004–2021. All rights reserved.