Package run.halo.gradle.docker
Class AbstractDockerRemoteApiTask
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
run.halo.gradle.docker.AbstractDockerRemoteApiTask
- All Implemented Interfaces:
Comparable<org.gradle.api.Task>,org.gradle.api.internal.DynamicObjectAware,org.gradle.api.internal.TaskInternal,org.gradle.api.Named,org.gradle.api.plugins.ExtensionAware,org.gradle.api.Task,org.gradle.util.Configurable<org.gradle.api.Task>
- Direct Known Subclasses:
DockerExistingContainer,DockerExistingImage,DockerPullImage
public abstract class AbstractDockerRemoteApiTask
extends org.gradle.api.DefaultTask
- Since:
- 2.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Task
org.gradle.api.Task.Namer -
Field Summary
Fields inherited from interface org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal org.gradle.api.provider.Property<String>The Docker remote API version.final org.gradle.api.file.DirectoryPropertyPath to the Docker certificate and key.com.github.dockerjava.api.DockerClientGets the Docker client uses to communicate with Docker via its remote API.final org.gradle.api.provider.Property<DockerClientService>protected org.gradle.api.Action<? super Object>final org.gradle.api.provider.Property<String>getUrl()Docker remote API server URL.voidonComplete(Runnable callback) Reacts to the completion of the operation.voidReacts to a potential error occurring during the operation.voidReacts to data returned by an operation.abstract voidvoidstart()Methods inherited from class org.gradle.api.DefaultTask
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesServiceMethods inherited from class org.gradle.api.internal.AbstractTask
acceptServiceReferences, appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjectsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.Task
doNotTrackState, getConvention, notCompatibleWithConfigurationCache
-
Constructor Details
-
AbstractDockerRemoteApiTask
public AbstractDockerRemoteApiTask()
-
-
Method Details
-
getUrl
Docker remote API server URL. Defaults to "tcp://localhost:2375". -
getCertPath
@InputDirectory @PathSensitive(RELATIVE) @Optional public final org.gradle.api.file.DirectoryProperty getCertPath()Path to the Docker certificate and key. -
getApiVersion
The Docker remote API version. -
getDockerClientService
@Internal public final org.gradle.api.provider.Property<DockerClientService> getDockerClientService() -
start
- Throws:
Exception
-
onError
Reacts to a potential error occurring during the operation.- Parameters:
action- The action handling the error- Since:
- 4.0.0
-
onNext
Reacts to data returned by an operation.- Parameters:
action- The action handling the data- Since:
- 4.0.0
-
getNextHandler
-
onComplete
Reacts to the completion of the operation.- Parameters:
callback- The callback to be executed- Since:
- 4.0.0
-
getDockerClient
@Internal public com.github.dockerjava.api.DockerClient getDockerClient()Gets the Docker client uses to communicate with Docker via its remote API. Initialized instance upon first request. Returns the same instance for any successive method call. To support the configuration cache we rely on DockerClientService's internal cache.Before accessing the Docker client, all data used for configuring its runtime behavior needs to be evaluated. The data includes:
- The property values of this class
- The plugin's extension property values
It is safe to access the Docker client under the following conditions:
- In the task action
- In the task's constructor if used in
ActionorClosureofoutputs.upToDateWhen
- Returns:
- The Docker client
-
runRemoteCommand
- Throws:
Exception
-