public abstract class DockerSlaveProvisioner extends Object
DockerSlave instance might be registered as a Node
before or after the container have been created.| Modifier and Type | Field and Description |
|---|---|
protected com.github.dockerjava.api.DockerClient |
client |
protected DockerCloud |
cloud |
protected String |
container |
protected DockerTemplate |
template |
| Constructor and Description |
|---|
DockerSlaveProvisioner(DockerCloud cloud,
DockerTemplate template,
com.github.dockerjava.api.DockerClient client) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
prepareCreateContainerCommand(com.github.dockerjava.api.command.CreateContainerCmd cmd)
Implementation can override this method to customize the container to be created as Jenkins Agent.
|
abstract DockerSlave |
provision()
Provision and setup container(s) to create an active
DockerSlave. |
protected void |
pullImage() |
protected String |
runContainer() |
protected void |
setupContainer()
Implementation can override this method to customize the container before it get started.
|
protected final DockerCloud cloud
protected final DockerTemplate template
protected final com.github.dockerjava.api.DockerClient client
@CheckForNull protected String container
public DockerSlaveProvisioner(DockerCloud cloud, DockerTemplate template, com.github.dockerjava.api.DockerClient client)
public abstract DockerSlave provision() throws IOException, hudson.model.Descriptor.FormException, InterruptedException
DockerSlave.IOExceptionhudson.model.Descriptor.FormExceptionInterruptedExceptionprotected String runContainer() throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected void pullImage()
protected void prepareCreateContainerCommand(com.github.dockerjava.api.command.CreateContainerCmd cmd)
throws com.github.dockerjava.api.exception.DockerException,
IOException
com.github.dockerjava.api.exception.DockerExceptionIOExceptionprotected void setupContainer()
throws IOException,
InterruptedException
slave.jar into container, etcIOExceptionInterruptedExceptionCopyright © 2016–2017. All rights reserved.