com.bmuschko.gradle.docker.tasks.network.DockerCreateNetwork.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-docker-plugin Show documentation
Show all versions of gradle-docker-plugin Show documentation
Gradle plugin for managing Docker images and containers.
package com.bmuschko.gradle.docker.tasks.network
import com.bmuschko.gradle.docker.tasks.AbstractDockerRemoteApiTask
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Input
class DockerCreateNetwork extends AbstractDockerRemoteApiTask {
@Input
final Property networkId = project.objects.property(String)
void runRemoteCommand(final dockerClient) {
logger.quiet "Creating network '${networkId.get()}'."
final network = dockerClient.createNetworkCmd().withName(networkId.get()).exec()
if (nextHandler) {
nextHandler.execute(network)
}
}
}