public class SSHLauncher
extends hudson.slaves.ComputerLauncher
Modifier and Type | Class and Description |
---|---|
static class |
SSHLauncher.DefaultJavaProvider |
static class |
SSHLauncher.DefaultJDKInstaller
Deprecated.
Subtype of
JDKInstaller causes JENKINS-10641. |
static class |
SSHLauncher.DescriptorImpl |
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_JDK |
String |
javaPath
Field javaPath.
|
static String |
JDKVERSION |
Integer |
launchTimeoutSeconds
Field launchTimeoutSeconds.
|
Integer |
maxNumRetries
Field maxNumRetries.
|
String |
prefixStartSlaveCmd
Field prefixStartSlaveCmd.
|
Integer |
retryWaitTime
Field retryWaitTime.
|
static com.cloudbees.plugins.credentials.domains.SchemeRequirement |
SSH_SCHEME
The scheme requirement.
|
String |
suffixStartSlaveCmd
Field suffixStartSlaveCmd.
|
Constructor and Description |
---|
SSHLauncher(String host,
int port,
com.cloudbees.jenkins.plugins.sshcredentials.SSHUser credentials,
String jvmOptions,
String javaPath,
hudson.tools.JDKInstaller jdkInstaller,
String prefixStartSlaveCmd,
String suffixStartSlaveCmd)
Deprecated.
|
SSHLauncher(String host,
int port,
com.cloudbees.jenkins.plugins.sshcredentials.SSHUser credentials,
String jvmOptions,
String javaPath,
String prefixStartSlaveCmd,
String suffixStartSlaveCmd)
Deprecated.
|
SSHLauncher(String host,
int port,
com.cloudbees.plugins.credentials.common.StandardUsernameCredentials credentials,
String jvmOptions,
String javaPath,
hudson.tools.JDKInstaller jdkInstaller,
String prefixStartSlaveCmd,
String suffixStartSlaveCmd)
Deprecated.
|
SSHLauncher(String host,
int port,
com.cloudbees.plugins.credentials.common.StandardUsernameCredentials credentials,
String jvmOptions,
String javaPath,
hudson.tools.JDKInstaller jdkInstaller,
String prefixStartSlaveCmd,
String suffixStartSlaveCmd,
Integer launchTimeoutSeconds,
Integer maxNumRetries,
Integer retryWaitTime)
Constructor SSHLauncher creates a new SSHLauncher instance.
|
SSHLauncher(String host,
int port,
com.cloudbees.plugins.credentials.common.StandardUsernameCredentials credentials,
String jvmOptions,
String javaPath,
String prefixStartSlaveCmd,
String suffixStartSlaveCmd)
|
SSHLauncher(String host,
int port,
com.cloudbees.plugins.credentials.common.StandardUsernameCredentials credentials,
String jvmOptions,
String javaPath,
String prefixStartSlaveCmd,
String suffixStartSlaveCmd,
Integer launchTimeoutSeconds)
|
SSHLauncher(String host,
int port,
com.cloudbees.plugins.credentials.common.StandardUsernameCredentials credentials,
String jvmOptions,
String javaPath,
String prefixStartSlaveCmd,
String suffixStartSlaveCmd,
Integer launchTimeoutSeconds,
Integer maxNumRetries,
Integer retryWaitTime)
Constructor SSHLauncher creates a new SSHLauncher instance.
|
SSHLauncher(String host,
int port,
String username,
String password,
String privatekey,
String jvmOptions) |
SSHLauncher(String host,
int port,
String credentialsId,
String jvmOptions,
String javaPath,
String prefixStartSlaveCmd,
String suffixStartSlaveCmd)
Deprecated.
use
SSHLauncher#(String,int,String,String,String,String,String,Integer) |
SSHLauncher(String host,
int port,
String credentialsId,
String jvmOptions,
String javaPath,
String prefixStartSlaveCmd,
String suffixStartSlaveCmd,
Integer launchTimeoutSeconds)
Deprecated.
|
SSHLauncher(String host,
int port,
String credentialsId,
String jvmOptions,
String javaPath,
String prefixStartSlaveCmd,
String suffixStartSlaveCmd,
Integer launchTimeoutSeconds,
Integer maxNumRetries,
Integer retryWaitTime)
Constructor SSHLauncher creates a new SSHLauncher instance.
|
SSHLauncher(String host,
int port,
String username,
String password,
String privatekey,
String jvmOptions,
String javaPath,
hudson.tools.JDKInstaller jdkInstaller,
String prefixStartSlaveCmd,
String suffixStartSlaveCmd)
Deprecated.
use the
StandardUsernameCredentials based version |
SSHLauncher(String host,
int port,
String username,
String password,
String privatekey,
String jvmOptions,
String javaPath,
String prefixStartSlaveCmd,
String suffixStartSlaveCmd)
Deprecated.
use the
StandardUsernameCredentials based version |
Modifier and Type | Method and Description |
---|---|
void |
afterDisconnect(hudson.slaves.SlaveComputer slaveComputer,
hudson.model.TaskListener listener) |
protected String |
checkJavaVersion(PrintStream logger,
String javaCommand,
BufferedReader r,
StringWriter output)
Given the output of "java -version" in
r , determine if this
version of Java is supported. |
com.trilead.ssh2.Connection |
getConnection() |
com.cloudbees.plugins.credentials.common.StandardUsernameCredentials |
getCredentials() |
String |
getCredentialsId() |
String |
getHost()
Getter for property 'host'.
|
String |
getJavaPath()
Gets the optionnal java command to use to launch the slave JVM.
|
String |
getJvmOptions()
Gets the JVM Options used to launch the slave JVM.
|
Integer |
getLaunchTimeoutSeconds()
Getter for property 'launchTimeoutSeconds'
|
Integer |
getMaxNumRetries()
Getter for property 'maxNumRetries'
|
String |
getPassword()
Deprecated.
|
int |
getPort()
Getter for property 'port'.
|
String |
getPrefixStartSlaveCmd() |
String |
getPrivatekey()
Deprecated.
|
Integer |
getRetryWaitTime()
Getter for property 'retryWaitTime'
|
String |
getSuffixStartSlaveCmd() |
protected String |
getTimestamp()
Gets the formatted current time stamp.
|
String |
getUsername()
Deprecated.
|
boolean |
isLaunchSupported() |
void |
launch(hudson.slaves.SlaveComputer computer,
hudson.model.TaskListener listener) |
static com.cloudbees.plugins.credentials.common.StandardUsernameCredentials |
lookupSystemCredentials(String credentialsId) |
static com.cloudbees.plugins.credentials.common.StandardUsernameCredentials |
lookupSystemCredentials(String credentialsId,
String host,
int port) |
protected void |
openConnection(hudson.model.TaskListener listener) |
protected void |
reportEnvironment(hudson.model.TaskListener listener) |
protected String |
resolveJava(hudson.slaves.SlaveComputer computer,
hudson.model.TaskListener listener)
return javaPath if specified in the configuration.
|
public static final com.cloudbees.plugins.credentials.domains.SchemeRequirement SSH_SCHEME
public static final String JDKVERSION
public static final String DEFAULT_JDK
public final String javaPath
public final String prefixStartSlaveCmd
public final String suffixStartSlaveCmd
public final Integer launchTimeoutSeconds
public final Integer maxNumRetries
public final Integer retryWaitTime
@DataBoundConstructor public SSHLauncher(String host, int port, String credentialsId, String jvmOptions, String javaPath, String prefixStartSlaveCmd, String suffixStartSlaveCmd, Integer launchTimeoutSeconds, Integer maxNumRetries, Integer retryWaitTime)
host
- The host to connect to.port
- The port to connect on.credentialsId
- The credentials id to connect as.jvmOptions
- Options passed to the java vm.javaPath
- Path to the host jdk installation. If null
the jdk will be auto detected or installed by the JDKInstaller.prefixStartSlaveCmd
- This will prefix the start slave command. For instance if you want to execute the command with a different shell.suffixStartSlaveCmd
- This will suffix the start slave command.launchTimeoutSeconds
- Launch timeout in secondsmaxNumRetries
- The number of times to retry connection if the SSH connection is refused during initial connectretryWaitTime
- The number of seconds to wait between retries@Deprecated public SSHLauncher(String host, int port, String credentialsId, String jvmOptions, String javaPath, String prefixStartSlaveCmd, String suffixStartSlaveCmd, Integer launchTimeoutSeconds)
SSHLauncher(String, int, String, String, String, String, String, Integer, Integer, Integer)
instead.@Deprecated public SSHLauncher(String host, int port, String credentialsId, String jvmOptions, String javaPath, String prefixStartSlaveCmd, String suffixStartSlaveCmd)
SSHLauncher#(String,int,String,String,String,String,String,Integer)
public SSHLauncher(String host, int port, com.cloudbees.plugins.credentials.common.StandardUsernameCredentials credentials, String jvmOptions, String javaPath, String prefixStartSlaveCmd, String suffixStartSlaveCmd, Integer launchTimeoutSeconds, Integer maxNumRetries, Integer retryWaitTime)
host
- The host to connect to.port
- The port to connect on.credentials
- The credentials to connect as.jvmOptions
- Options passed to the java vm.javaPath
- Path to the host jdk installation. If null
the jdk will be auto detected or installed by the JDKInstaller.prefixStartSlaveCmd
- This will prefix the start slave command. For instance if you want to execute the command with a different shell.suffixStartSlaveCmd
- This will suffix the start slave command.launchTimeoutSeconds
- Launch timeout in secondsmaxNumRetries
- The number of times to retry connection if the SSH connection is refused during initial connectretryWaitTime
- The number of seconds to wait between retries@Deprecated public SSHLauncher(String host, int port, com.cloudbees.plugins.credentials.common.StandardUsernameCredentials credentials, String jvmOptions, String javaPath, String prefixStartSlaveCmd, String suffixStartSlaveCmd, Integer launchTimeoutSeconds)
@Deprecated public SSHLauncher(String host, int port, com.cloudbees.plugins.credentials.common.StandardUsernameCredentials credentials, String jvmOptions, String javaPath, String prefixStartSlaveCmd, String suffixStartSlaveCmd)
@Deprecated public SSHLauncher(String host, int port, com.cloudbees.jenkins.plugins.sshcredentials.SSHUser credentials, String jvmOptions, String javaPath, String prefixStartSlaveCmd, String suffixStartSlaveCmd)
SSHLauncher(String, int, StandardUsernameCredentials, String, String, String, String)
instead.@Deprecated public SSHLauncher(String host, int port, String username, String password, String privatekey, String jvmOptions, String javaPath, String prefixStartSlaveCmd, String suffixStartSlaveCmd)
StandardUsernameCredentials
based versionhost
- The host to connect to.port
- The port to connect on.username
- The username to connect as.password
- The password to connect with.privatekey
- The ssh privatekey to connect with.jvmOptions
- Options passed to the java vm.javaPath
- Path to the host jdk installation. If null
the jdk will be auto detected or installed by the JDKInstaller.prefixStartSlaveCmd
- This will prefix the start slave command. For instance if you want to execute the command with a different shell.suffixStartSlaveCmd
- This will suffix the start slave command.@Deprecated public SSHLauncher(String host, int port, String username, String password, String privatekey, String jvmOptions, String javaPath, hudson.tools.JDKInstaller jdkInstaller, String prefixStartSlaveCmd, String suffixStartSlaveCmd)
StandardUsernameCredentials
based versionhost
- The host to connect to.port
- The port to connect on.username
- The username to connect as.password
- The password to connect with.privatekey
- The ssh privatekey to connect with.jvmOptions
- Options passed to the java vm.javaPath
- Path to the host jdk installation. If null
the jdk will be auto detected or installed by the JDKInstaller.jdkInstaller
- The jdk installer that will be used if no java vm is found on the specified host. If null
the SSHLauncher.DefaultJDKInstaller
will be used.prefixStartSlaveCmd
- This will prefix the start slave command. For instance if you want to execute the command with a different shell.suffixStartSlaveCmd
- This will suffix the start slave command.@Deprecated public SSHLauncher(String host, int port, com.cloudbees.plugins.credentials.common.StandardUsernameCredentials credentials, String jvmOptions, String javaPath, hudson.tools.JDKInstaller jdkInstaller, String prefixStartSlaveCmd, String suffixStartSlaveCmd)
host
- The host to connect to.port
- The port to connect on.credentials
- The credentials to connect as.jvmOptions
- Options passed to the java vm.javaPath
- Path to the host jdk installation. If null
the jdk will be auto detected or installed by the JDKInstaller.jdkInstaller
- The jdk installer that will be used if no java vm is found on the specified host. If null
the SSHLauncher.DefaultJDKInstaller
will be used.prefixStartSlaveCmd
- This will prefix the start slave command. For instance if you want to execute the command with a different shell.suffixStartSlaveCmd
- This will suffix the start slave command.public SSHLauncher(String host, int port, com.cloudbees.plugins.credentials.common.StandardUsernameCredentials credentials, String jvmOptions, String javaPath, hudson.tools.JDKInstaller jdkInstaller, String prefixStartSlaveCmd, String suffixStartSlaveCmd, Integer launchTimeoutSeconds, Integer maxNumRetries, Integer retryWaitTime)
host
- The host to connect to.port
- The port to connect on.credentials
- The credentials to connect as.jvmOptions
- Options passed to the java vm.javaPath
- Path to the host jdk installation. If null
the jdk will be auto detected or installed by the JDKInstaller.jdkInstaller
- The jdk installer that will be used if no java vm is found on the specified host. If null
the SSHLauncher.DefaultJDKInstaller
will be used.prefixStartSlaveCmd
- This will prefix the start slave command. For instance if you want to execute the command with a different shell.suffixStartSlaveCmd
- This will suffix the start slave command.launchTimeoutSeconds
- Launch timeout in secondsmaxNumRetries
- The number of times to retry connection if the SSH connection is refused during initial connectretryWaitTime
- The number of seconds to wait between retries@Deprecated public SSHLauncher(String host, int port, com.cloudbees.jenkins.plugins.sshcredentials.SSHUser credentials, String jvmOptions, String javaPath, hudson.tools.JDKInstaller jdkInstaller, String prefixStartSlaveCmd, String suffixStartSlaveCmd)
SSHLauncher(String, int, StandardUsernameCredentials, String, String, JDKInstaller, String, String)
instead.public static com.cloudbees.plugins.credentials.common.StandardUsernameCredentials lookupSystemCredentials(String credentialsId)
public static com.cloudbees.plugins.credentials.common.StandardUsernameCredentials lookupSystemCredentials(String credentialsId, String host, int port)
public String getCredentialsId()
public com.cloudbees.plugins.credentials.common.StandardUsernameCredentials getCredentials()
public boolean isLaunchSupported()
isLaunchSupported
in class hudson.slaves.ComputerLauncher
public String getJvmOptions()
public String getJavaPath()
protected String getTimestamp()
public void launch(hudson.slaves.SlaveComputer computer, hudson.model.TaskListener listener) throws InterruptedException
launch
in class hudson.slaves.ComputerLauncher
InterruptedException
protected String resolveJava(hudson.slaves.SlaveComputer computer, hudson.model.TaskListener listener) throws InterruptedException, hudson.util.IOException2
InterruptedException
hudson.util.IOException2
protected void reportEnvironment(hudson.model.TaskListener listener) throws IOException, InterruptedException
IOException
InterruptedException
@CheckForNull protected String checkJavaVersion(PrintStream logger, String javaCommand, BufferedReader r, StringWriter output) throws IOException
r
, determine if this
version of Java is supported. This method has default visiblity for testing.logger
- where to log the outputjavaCommand
- the command executed, used for loggingr
- the output of "java -version"output
- copy the data from r
into this output bufferIOException
protected void openConnection(hudson.model.TaskListener listener) throws IOException, InterruptedException
IOException
InterruptedException
public void afterDisconnect(hudson.slaves.SlaveComputer slaveComputer, hudson.model.TaskListener listener)
afterDisconnect
in class hudson.slaves.ComputerLauncher
public String getHost()
public int getPort()
@Deprecated public String getUsername()
@Deprecated public String getPassword()
@Deprecated public String getPrivatekey()
public com.trilead.ssh2.Connection getConnection()
public String getPrefixStartSlaveCmd()
public String getSuffixStartSlaveCmd()
public Integer getLaunchTimeoutSeconds()
public Integer getMaxNumRetries()
public Integer getRetryWaitTime()
Copyright © 2016. All rights reserved.