All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.gesellix.gradle.docker.tasks.DockerSwarmJoinTask Maven / Gradle / Ivy

package de.gesellix.gradle.docker.tasks;

import de.gesellix.docker.remote.api.SwarmJoinRequest;
import org.gradle.api.model.ObjectFactory;
import org.gradle.api.provider.Property;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.Optional;
import org.gradle.api.tasks.TaskAction;

import javax.inject.Inject;

public class DockerSwarmJoinTask extends GenericDockerTask {

  private final Property config;

  @Input
  @Optional
  public Property getConfig() {
    return config;
  }

  @Inject
  public DockerSwarmJoinTask(ObjectFactory objectFactory) {
    super(objectFactory);
    setDescription("Join a swarm as a node and/or manager");

    config = objectFactory.property(SwarmJoinRequest.class);
  }

  @TaskAction
  public void joinSwarm() {
    getLogger().info("docker swarm join");
    getDockerClient().joinSwarm(getConfig().get());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy