Package io.jenkins.docker.connector
Class DockerComputerSSHConnector
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<DockerComputerConnector>
-
- io.jenkins.docker.connector.DockerComputerConnector
-
- io.jenkins.docker.connector.DockerComputerSSHConnector
-
- All Implemented Interfaces:
Describable<DockerComputerConnector>
public class DockerComputerSSHConnector extends DockerComputerConnector
- Author:
- Nicolas De Loof
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DockerComputerSSHConnector.DescriptorImpl
static class
DockerComputerSSHConnector.InjectSSHKey
static class
DockerComputerSSHConnector.ManuallyConfiguredSSHKey
static class
DockerComputerSSHConnector.SSHKeyStrategy
-
Field Summary
-
Fields inherited from class io.jenkins.docker.connector.DockerComputerConnector
remoting
-
-
Constructor Summary
Constructors Constructor Description DockerComputerSSHConnector(DockerComputerSSHConnector.SSHKeyStrategy sshKeyStrategy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beforeContainerCreated(DockerAPI api, String workdir, com.github.dockerjava.api.command.CreateContainerCmd cmd)
Called just before the container is created.void
beforeContainerStarted(DockerAPI api, String workdir, DockerTransientNode node)
Called once the container has been created but not started yet, that's a good opportunity to injectremoting.jar
usingDockerComputerConnector.injectRemotingJar(String, String, DockerClient)
protected ComputerLauncher
createLauncher(DockerAPI api, String workdir, com.github.dockerjava.api.command.InspectContainerResponse inspect, TaskListener listener)
Create a Launcher to create an Agent with this container.boolean
equals(Object obj)
String
getJavaPath()
String
getJvmOptions()
Integer
getLaunchTimeoutSeconds()
Integer
getMaxNumRetries()
int
getPort()
String
getPrefixStartSlaveCmd()
Integer
getRetryWaitTime()
DockerComputerSSHConnector.SSHKeyStrategy
getSshKeyStrategy()
String
getSuffixStartSlaveCmd()
int
hashCode()
void
setJavaPath(String javaPath)
void
setJvmOptions(String jvmOptions)
void
setLaunchTimeoutSeconds(Integer launchTimeoutSeconds)
void
setMaxNumRetries(Integer maxNumRetries)
void
setPort(int port)
void
setPrefixStartSlaveCmd(String prefixStartSlaveCmd)
void
setRetryWaitTime(Integer retryWaitTime)
void
setSuffixStartSlaveCmd(String suffixStartSlaveCmd)
String
toString()
-
Methods inherited from class io.jenkins.docker.connector.DockerComputerConnector
addEnvVar, addEnvVars, afterContainerStarted, all, createLauncher, ensureNodeIsKnown, ensureWaiting, injectRemotingJar
-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Constructor Detail
-
DockerComputerSSHConnector
@DataBoundConstructor public DockerComputerSSHConnector(DockerComputerSSHConnector.SSHKeyStrategy sshKeyStrategy)
-
-
Method Detail
-
getSshKeyStrategy
public DockerComputerSSHConnector.SSHKeyStrategy getSshKeyStrategy()
-
getPort
public int getPort()
-
setPort
@DataBoundSetter public void setPort(int port)
-
getJvmOptions
@CheckForNull public String getJvmOptions()
-
setJvmOptions
@DataBoundSetter public void setJvmOptions(String jvmOptions)
-
getJavaPath
@CheckForNull public String getJavaPath()
-
setJavaPath
@DataBoundSetter public void setJavaPath(String javaPath)
-
getPrefixStartSlaveCmd
@CheckForNull public String getPrefixStartSlaveCmd()
-
setPrefixStartSlaveCmd
@DataBoundSetter public void setPrefixStartSlaveCmd(String prefixStartSlaveCmd)
-
getSuffixStartSlaveCmd
@CheckForNull public String getSuffixStartSlaveCmd()
-
setSuffixStartSlaveCmd
@DataBoundSetter public void setSuffixStartSlaveCmd(String suffixStartSlaveCmd)
-
getLaunchTimeoutSeconds
@CheckForNull public Integer getLaunchTimeoutSeconds()
-
setLaunchTimeoutSeconds
@DataBoundSetter public void setLaunchTimeoutSeconds(Integer launchTimeoutSeconds)
-
getMaxNumRetries
@CheckForNull public Integer getMaxNumRetries()
-
setMaxNumRetries
@DataBoundSetter public void setMaxNumRetries(Integer maxNumRetries)
-
getRetryWaitTime
@CheckForNull public Integer getRetryWaitTime()
-
setRetryWaitTime
@DataBoundSetter public void setRetryWaitTime(Integer retryWaitTime)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classDockerComputerConnector
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classDockerComputerConnector
-
beforeContainerCreated
public void beforeContainerCreated(DockerAPI api, String workdir, com.github.dockerjava.api.command.CreateContainerCmd cmd) throws IOException, InterruptedException
Description copied from class:DockerComputerConnector
Called just before the container is created. Can provide some customization to the container creation command.- Overrides:
beforeContainerCreated
in classDockerComputerConnector
- Parameters:
api
- TheDockerAPI
that this container belongs to.workdir
- The filesystem path to the Jenkins agent working directory.cmd
- TheCreateContainerCmd
that's about to be used.- Throws:
IOException
- If anything goes wrong.InterruptedException
- If interrupted while doing things.
-
beforeContainerStarted
public void beforeContainerStarted(DockerAPI api, String workdir, DockerTransientNode node) throws IOException, InterruptedException
Description copied from class:DockerComputerConnector
Called once the container has been created but not started yet, that's a good opportunity to injectremoting.jar
usingDockerComputerConnector.injectRemotingJar(String, String, DockerClient)
- Overrides:
beforeContainerStarted
in classDockerComputerConnector
- Parameters:
api
- TheDockerAPI
that this container belongs to.workdir
- The filesystem path to the Jenkins agent working directory.node
- The Jenkins node.- Throws:
IOException
- If anything goes wrong.InterruptedException
- If interrupted while doing things.
-
createLauncher
protected ComputerLauncher createLauncher(DockerAPI api, String workdir, com.github.dockerjava.api.command.InspectContainerResponse inspect, TaskListener listener) throws IOException, InterruptedException
Description copied from class:DockerComputerConnector
Create a Launcher to create an Agent with this container. Can assume container has been created by this DockerAgentConnector so adequate setup did take place.- Specified by:
createLauncher
in classDockerComputerConnector
- Parameters:
api
- TheDockerAPI
for the cloud this agent is running on.workdir
- The filesystem path to the Jenkins agent working directory.inspect
- Information from the docker daemon about our container.listener
- Where to output any issues.- Returns:
- A configured
ComputerLauncher
. - Throws:
IOException
- If anything goes wrong, e.g. talking to docker.InterruptedException
- If we're interrupted while waiting.
-
-