Package it.dockins.dockerslaves.drivers
Class CliDockerDriver
java.lang.Object
it.dockins.dockerslaves.spi.DockerDriver
it.dockins.dockerslaves.drivers.CliDockerDriver
- All Implemented Interfaces:
Closeable,AutoCloseable
- Author:
- Nicolas De Loof, Yoann Dubreuil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildDockerfile(TaskListener listener, String dockerfilePath, String tag, boolean pull) booleancheckImageExists(TaskListener listener, String image) voidclose()createVolume(TaskListener listener) execInContainer(TaskListener listener, String containerId, Launcher.ProcStarter starter) protected voidgetFileContent(Launcher launcher, String containerId, String filename, OutputStream outputStream) booleanhasContainer(TaskListener listener, String id) booleanhasVolume(TaskListener listener, String name) protected voidinjectJenkinsUnixGroup(Launcher launcher, String containerId) protected voidinjectJenkinsUnixUser(Launcher launcher, String containerId) protected voidinjectTrampoline(Launcher launcher, String containerId) launchBuildContainer(TaskListener listener, String image, Container remotingContainer, List<Hint> hints) launchRemotingContainer(TaskListener listener, String image, String volume, DockerComputer computer) launchSideContainer(TaskListener listener, String image, Container remotingContainer, List<Hint> hints) voidvoidpullImage(TaskListener listener, String image) protected intputFileContent(Launcher launcher, String containerId, String path, String filename, byte[] content) protected intputFileContent(Launcher launcher, String containerId, String path, String filename, byte[] content, Integer mode) voidremoveContainer(TaskListener listener, Container instance) serverVersion(TaskListener listener) Return server version string, used actually to check connectivity with backendbooleanusesSwarmMode(TaskListener listener)
-
Field Details
-
UTF_8
-
-
Constructor Details
-
CliDockerDriver
- Throws:
IOExceptionInterruptedException
-
-
Method Details
-
close
- Throws:
IOException
-
createVolume
- Specified by:
createVolumein classDockerDriver- Throws:
IOExceptionInterruptedException
-
hasVolume
public boolean hasVolume(TaskListener listener, String name) throws IOException, InterruptedException - Specified by:
hasVolumein classDockerDriver- Throws:
IOExceptionInterruptedException
-
hasContainer
public boolean hasContainer(TaskListener listener, String id) throws IOException, InterruptedException - Specified by:
hasContainerin classDockerDriver- Throws:
IOExceptionInterruptedException
-
launchRemotingContainer
public Container launchRemotingContainer(TaskListener listener, String image, String volume, DockerComputer computer) throws IOException, InterruptedException - Specified by:
launchRemotingContainerin classDockerDriver- Throws:
IOExceptionInterruptedException
-
launchBuildContainer
public Container launchBuildContainer(TaskListener listener, String image, Container remotingContainer, List<Hint> hints) throws IOException, InterruptedException - Specified by:
launchBuildContainerin classDockerDriver- Throws:
IOExceptionInterruptedException
-
injectJenkinsUnixGroup
protected void injectJenkinsUnixGroup(Launcher launcher, String containerId) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
injectJenkinsUnixUser
protected void injectJenkinsUnixUser(Launcher launcher, String containerId) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
injectTrampoline
protected void injectTrampoline(Launcher launcher, String containerId) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
getFileContent
protected void getFileContent(Launcher launcher, String containerId, String filename, OutputStream outputStream) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
putFileContent
protected int putFileContent(Launcher launcher, String containerId, String path, String filename, byte[] content) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
putFileContent
protected int putFileContent(Launcher launcher, String containerId, String path, String filename, byte[] content, Integer mode) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
execInContainer
public Proc execInContainer(TaskListener listener, String containerId, Launcher.ProcStarter starter) throws IOException, InterruptedException - Specified by:
execInContainerin classDockerDriver- Throws:
IOExceptionInterruptedException
-
removeContainer
public void removeContainer(TaskListener listener, Container instance) throws IOException, InterruptedException - Specified by:
removeContainerin classDockerDriver- Throws:
IOExceptionInterruptedException
-
launchSideContainer
public Container launchSideContainer(TaskListener listener, String image, Container remotingContainer, List<Hint> hints) throws IOException, InterruptedException - Specified by:
launchSideContainerin classDockerDriver- Throws:
IOExceptionInterruptedException
-
pullImage
- Specified by:
pullImagein classDockerDriver- Throws:
IOExceptionInterruptedException
-
checkImageExists
public boolean checkImageExists(TaskListener listener, String image) throws IOException, InterruptedException - Specified by:
checkImageExistsin classDockerDriver- Throws:
IOExceptionInterruptedException
-
buildDockerfile
public void buildDockerfile(TaskListener listener, String dockerfilePath, String tag, boolean pull) throws IOException, InterruptedException - Specified by:
buildDockerfilein classDockerDriver- Throws:
IOExceptionInterruptedException
-
serverVersion
Description copied from class:DockerDriverReturn server version string, used actually to check connectivity with backend- Specified by:
serverVersionin classDockerDriver- Throws:
IOExceptionInterruptedException
-
usesSwarmMode
- Throws:
IOExceptionInterruptedException
-
prependArgs
-