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>
- Author:
- Nicolas De Loof
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic classstatic classstatic class -
Field Summary
Fields inherited from class io.jenkins.docker.connector.DockerComputerConnector
remoting -
Constructor Summary
ConstructorsConstructorDescriptionDockerComputerSSHConnector(DockerComputerSSHConnector.SSHKeyStrategy sshKeyStrategy) -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeContainerCreated(DockerAPI api, String workdir, com.github.dockerjava.api.command.CreateContainerCmd cmd) Called just before the container is created.voidbeforeContainerStarted(DockerAPI api, String workdir, DockerTransientNode node) Called once the container has been created but not started yet, that's a good opportunity to injectremoting.jarusingDockerComputerConnector.injectRemotingJar(String, String, DockerClient)protected ComputerLaunchercreateLauncher(DockerAPI api, String workdir, com.github.dockerjava.api.command.InspectContainerResponse inspect, TaskListener listener) Create a Launcher to create an Agent with this container.booleanintgetPort()inthashCode()voidsetJavaPath(String javaPath) voidsetJvmOptions(String jvmOptions) voidsetLaunchTimeoutSeconds(Integer launchTimeoutSeconds) voidsetMaxNumRetries(Integer maxNumRetries) voidsetPort(int port) voidsetPrefixStartSlaveCmd(String prefixStartSlaveCmd) voidsetRetryWaitTime(Integer retryWaitTime) voidsetSuffixStartSlaveCmd(String suffixStartSlaveCmd) toString()Methods inherited from class io.jenkins.docker.connector.DockerComputerConnector
addEnvVar, addEnvVars, afterContainerStarted, all, createLauncher, ensureNodeIsKnown, ensureWaiting, injectRemotingJarMethods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Constructor Details
-
DockerComputerSSHConnector
@DataBoundConstructor public DockerComputerSSHConnector(DockerComputerSSHConnector.SSHKeyStrategy sshKeyStrategy)
-
-
Method Details
-
getSshKeyStrategy
-
getPort
public int getPort() -
setPort
@DataBoundSetter public void setPort(int port) -
getJvmOptions
-
setJvmOptions
-
getJavaPath
-
setJavaPath
-
getPrefixStartSlaveCmd
-
setPrefixStartSlaveCmd
-
getSuffixStartSlaveCmd
-
setSuffixStartSlaveCmd
-
getLaunchTimeoutSeconds
-
setLaunchTimeoutSeconds
-
getMaxNumRetries
-
setMaxNumRetries
-
getRetryWaitTime
-
setRetryWaitTime
-
hashCode
public int hashCode()- Overrides:
hashCodein classDockerComputerConnector
-
equals
- Overrides:
equalsin classDockerComputerConnector
-
toString
-
beforeContainerCreated
public void beforeContainerCreated(DockerAPI api, String workdir, com.github.dockerjava.api.command.CreateContainerCmd cmd) throws IOException, InterruptedException Description copied from class:DockerComputerConnectorCalled just before the container is created. Can provide some customization to the container creation command.- Overrides:
beforeContainerCreatedin classDockerComputerConnector- Parameters:
api- TheDockerAPIthat this container belongs to.workdir- The filesystem path to the Jenkins agent working directory.cmd- TheCreateContainerCmdthat'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:DockerComputerConnectorCalled once the container has been created but not started yet, that's a good opportunity to injectremoting.jarusingDockerComputerConnector.injectRemotingJar(String, String, DockerClient)- Overrides:
beforeContainerStartedin classDockerComputerConnector- Parameters:
api- TheDockerAPIthat 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:DockerComputerConnectorCreate 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:
createLauncherin classDockerComputerConnector- Parameters:
api- TheDockerAPIfor 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.
-