public class SSHLauncher
extends hudson.slaves.ComputerLauncher
| Modifier and Type | Class and Description |
|---|---|
static class |
SSHLauncher.DescriptorImpl |
| Modifier and Type | Field and Description |
|---|---|
static String |
AGENT_JAR |
static Integer |
DEFAULT_LAUNCH_TIMEOUT_SECONDS |
static Integer |
DEFAULT_MAX_NUM_RETRIES |
static Integer |
DEFAULT_RETRY_WAIT_TIME |
String |
javaPath
Field javaPath.
|
Integer |
launchTimeoutSeconds
Field launchTimeoutSeconds.
|
Integer |
maxNumRetries
Field maxNumRetries.
|
String |
prefixStartSlaveCmd
Field prefixStartSlaveCmd.
|
Integer |
retryWaitTime
Field retryWaitTime (seconds).
|
static String |
SLASH_AGENT_JAR |
static com.cloudbees.plugins.credentials.domains.SchemeRequirement |
SSH_SCHEME
The scheme requirement.
|
String |
suffixStartSlaveCmd
Field suffixStartSlaveCmd.
|
static String |
WORK_DIR_PARAM |
| 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)
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,
SshHostKeyVerificationStrategy sshHostKeyVerificationStrategy)
Deprecated.
deprecated but used by not deprecated constructor
|
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)
|
SSHLauncher(String host,
int port,
String credentialsId,
String jvmOptions,
String javaPath,
hudson.tools.JDKInstaller jdkInstaller,
String prefixStartSlaveCmd,
String suffixStartSlaveCmd,
Integer launchTimeoutSeconds,
Integer maxNumRetries,
Integer retryWaitTime,
SshHostKeyVerificationStrategy sshHostKeyVerificationStrategy)
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)
|
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)
Deprecated.
|
SSHLauncher(String host,
int port,
String credentialsId,
String jvmOptions,
String javaPath,
String prefixStartSlaveCmd,
String suffixStartSlaveCmd,
Integer launchTimeoutSeconds,
Integer maxNumRetries,
Integer retryWaitTime,
SshHostKeyVerificationStrategy sshHostKeyVerificationStrategy)
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) |
com.trilead.ssh2.Connection |
getConnection() |
com.cloudbees.plugins.credentials.common.StandardUsernameCredentials |
getCredentials() |
String |
getCredentialsId() |
String |
getHost()
Getter for property 'host'.
|
String |
getJavaPath()
Deprecated.
|
String |
getJvmOptions()
Gets the optional JVM Options used to launch the agent 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'
|
SshHostKeyVerificationStrategy |
getSshHostKeyVerificationStrategy() |
String |
getSuffixStartSlaveCmd() |
boolean |
getTcpNoDelay() |
static String |
getTimestamp()
Gets the formatted current time stamp.
|
boolean |
getTrackCredentials()
Enable/Disable the credential tracking, this tracking store information about where it is used a credential,
in this case in a node.
|
String |
getUsername()
Deprecated.
|
String |
getWorkDir() |
String |
getWorkDirParam(String workingDirectory) |
static String |
getWorkingDirectory(hudson.slaves.SlaveComputer computer)
Returns the remote root workspace (without trailing slash).
|
boolean |
isLaunchSupported() |
void |
launch(hudson.slaves.SlaveComputer computer,
hudson.model.TaskListener listener) |
String |
logConfiguration() |
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,
hudson.slaves.SlaveComputer computer) |
Object |
readResolve() |
protected void |
reportEnvironment(hudson.model.TaskListener listener) |
void |
setTcpNoDelay(boolean tcpNoDelay) |
void |
setWorkDir(String workDir) |
public static final com.cloudbees.plugins.credentials.domains.SchemeRequirement SSH_SCHEME
public static final Integer DEFAULT_MAX_NUM_RETRIES
public static final Integer DEFAULT_RETRY_WAIT_TIME
public static final Integer DEFAULT_LAUNCH_TIMEOUT_SECONDS
public static final String AGENT_JAR
public static final String SLASH_AGENT_JAR
public static final String WORK_DIR_PARAM
public final String javaPath
public final String prefixStartSlaveCmd
public final String suffixStartSlaveCmd
public Integer launchTimeoutSeconds
public Integer maxNumRetries
public 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, SshHostKeyVerificationStrategy sshHostKeyVerificationStrategy)
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.prefixStartSlaveCmd - This will prefix the start agent command. For instance if you want to execute the command with a different shell.suffixStartSlaveCmd - This will suffix the start agent 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, 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.prefixStartSlaveCmd - This will prefix the start agent command. For instance if you want to execute the command with a different shell.suffixStartSlaveCmd - This will suffix the start agent 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)
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)
SSHLauncher(String, int, String, String, String, JDKInstaller, String, String, Integer, Integer, Integer, SshHostKeyVerificationStrategy) instead.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.prefixStartSlaveCmd - This will prefix the start agent command. For instance if you want to execute the command with a different shell.suffixStartSlaveCmd - This will suffix the start agent 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.prefixStartSlaveCmd - This will prefix the start agent command. For instance if you want to execute the command with a different shell.suffixStartSlaveCmd - This will suffix the start agent 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.jdkInstaller - not used.prefixStartSlaveCmd - This will prefix the start agent command. For instance if you want to execute the command with a different shell.suffixStartSlaveCmd - This will suffix the start agent 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.jdkInstaller - not used.prefixStartSlaveCmd - This will prefix the start agent command. For instance if you want to execute the command with a different shell.suffixStartSlaveCmd - This will suffix the start agent 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, 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 .jdkInstaller - not used.prefixStartSlaveCmd - This will prefix the start agent command. For instance if you want to execute the command with a different shell.suffixStartSlaveCmd - This will suffix the start agent 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, hudson.tools.JDKInstaller jdkInstaller, String prefixStartSlaveCmd, String suffixStartSlaveCmd, Integer launchTimeoutSeconds, Integer maxNumRetries, Integer retryWaitTime, SshHostKeyVerificationStrategy sshHostKeyVerificationStrategy)
public SSHLauncher(String host, int port, String credentialsId, String jvmOptions, String javaPath, hudson.tools.JDKInstaller jdkInstaller, String prefixStartSlaveCmd, String suffixStartSlaveCmd, Integer launchTimeoutSeconds, Integer maxNumRetries, Integer retryWaitTime, SshHostKeyVerificationStrategy sshHostKeyVerificationStrategy)
host - The host to connect to.port - The port to connect on.credentialsId - 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.jdkInstaller - not used.prefixStartSlaveCmd - This will prefix the start agent command. For instance if you want to execute the command with a different shell.suffixStartSlaveCmd - This will suffix the start agent 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 Object readResolve()
public String getCredentialsId()
@CheckForNull public SshHostKeyVerificationStrategy getSshHostKeyVerificationStrategy()
public com.cloudbees.plugins.credentials.common.StandardUsernameCredentials getCredentials()
public boolean isLaunchSupported()
isLaunchSupported in class hudson.slaves.ComputerLauncherpublic String getJvmOptions()
@Deprecated public String getJavaPath()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static String getTimestamp()
@CheckForNull public static String getWorkingDirectory(hudson.slaves.SlaveComputer computer)
computer - The slave computer to get the root workspace of.public void launch(hudson.slaves.SlaveComputer computer,
hudson.model.TaskListener listener)
throws InterruptedException
launch in class hudson.slaves.ComputerLauncherInterruptedExceptionprotected void reportEnvironment(hudson.model.TaskListener listener)
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionprotected void openConnection(hudson.model.TaskListener listener,
hudson.slaves.SlaveComputer computer)
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic void afterDisconnect(hudson.slaves.SlaveComputer slaveComputer,
hudson.model.TaskListener listener)
afterDisconnect in class hudson.slaves.ComputerLauncherpublic String getHost()
public int getPort()
@Deprecated public String getUsername()
@Deprecated public String getPassword()
@Deprecated public String getPrivatekey()
public com.trilead.ssh2.Connection getConnection()
@NonNull public String getPrefixStartSlaveCmd()
@NonNull public String getSuffixStartSlaveCmd()
@NonNull public Integer getLaunchTimeoutSeconds()
@NonNull public Integer getMaxNumRetries()
@NonNull public Integer getRetryWaitTime()
public boolean getTcpNoDelay()
@DataBoundSetter public void setTcpNoDelay(boolean tcpNoDelay)
public boolean getTrackCredentials()
public String getWorkDir()
@DataBoundSetter public void setWorkDir(String workDir)
@NonNull @Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public String getWorkDirParam(@NonNull String workingDirectory)
workingDirectory - The Working directory set on the configuration of the node.public String logConfiguration()
Copyright © 2016–2018. All rights reserved.