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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final org.gradle.api.provider.Property<String>
    The Docker remote API version.
    final org.gradle.api.file.DirectoryProperty
    com.github.dockerjava.api.DockerClient
    Gets 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>
    Docker remote API server URL.
    void
    onComplete(Runnable callback)
    Reacts to the completion of the operation.
    void
    onError(org.gradle.api.Action<? super Throwable> action)
    Reacts to a potential error occurring during the operation.
    void
    onNext(org.gradle.api.Action<? super Object> action)
    Reacts to data returned by an operation.
    abstract void
     
    void
     

    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, usesService

    Methods 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, setImpliesSubProjects

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, getConvention, notCompatibleWithConfigurationCache
  • Constructor Details

    • AbstractDockerRemoteApiTask

      public AbstractDockerRemoteApiTask()
  • Method Details

    • getUrl

      @Input @Optional public final org.gradle.api.provider.Property<String> getUrl()
      Docker remote API server URL. Defaults to "tcp://localhost:2375".
    • getCertPath

      @InputDirectory @PathSensitive(RELATIVE) @Optional public final org.gradle.api.file.DirectoryProperty getCertPath()
    • getApiVersion

      @Input @Optional public final org.gradle.api.provider.Property<String> getApiVersion()
      The Docker remote API version.
    • getDockerClientService

      @Internal public final org.gradle.api.provider.Property<DockerClientService> getDockerClientService()
    • start

      public void start() throws Exception
      Throws:
      Exception
    • onError

      public void onError(org.gradle.api.Action<? super Throwable> action)
      Reacts to a potential error occurring during the operation.
      Parameters:
      action - The action handling the error
      Since:
      4.0.0
    • onNext

      public void onNext(org.gradle.api.Action<? super Object> action)
      Reacts to data returned by an operation.
      Parameters:
      action - The action handling the data
      Since:
      4.0.0
    • getNextHandler

      @Internal protected org.gradle.api.Action<? super Object> getNextHandler()
    • onComplete

      public void onComplete(Runnable callback)
      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:

      1. The property values of this class
      2. The plugin's extension property values

      It is safe to access the Docker client under the following conditions:

      1. In the task action
      2. In the task's constructor if used in Action or Closure of outputs.upToDateWhen
      Returns:
      The Docker client
    • runRemoteCommand

      public abstract void runRemoteCommand() throws Exception
      Throws:
      Exception