pottering about with making a docker-compose plugin
This commit is contained in:
parent
16dc72ae71
commit
805d4c8170
7 changed files with 177 additions and 6 deletions
|
|
@ -45,10 +45,8 @@ val dockerRemove by tasks.registering(Exec::class) {
|
|||
}
|
||||
|
||||
|
||||
afterEvaluate {
|
||||
tasks.named("processRun") { dependsOn(dockerUp, dockerEnvUpdate) }
|
||||
tasks.named("processKill") { dependsOn(dockerDown) }
|
||||
}
|
||||
tasks.matching { it.name == "processRun" }.configureEach { dependsOn(dockerUp, dockerEnvUpdate) }
|
||||
tasks.matching { it.name == "processKill" }.configureEach { dependsOn(dockerDown) }
|
||||
|
||||
|
||||
val dockerEnvUpdate by tasks.registering(DockerEnvUpdateTask::class) {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import org.gradle.work.NormalizeLineEndings
|
|||
import org.jetbrains.kotlin.util.parseSpaceSeparatedArgs
|
||||
|
||||
@CacheableTask
|
||||
@Suppress("UnstableApiUsage")
|
||||
abstract class DockerComposeExec @Inject constructor(
|
||||
private val executor: ExecOperations,
|
||||
private val objects: ObjectFactory,
|
||||
|
|
@ -57,8 +58,9 @@ abstract class DockerComposeExec @Inject constructor(
|
|||
group = DOCKER_COMPOSE_GROUP
|
||||
logging.captureStandardOutput(LogLevel.LIFECYCLE)
|
||||
|
||||
super.onlyIf {
|
||||
it is DockerComposeExec && it.dockerIsActive.getOrElse(false)
|
||||
super.onlyIf { task ->
|
||||
require(task is DockerComposeExec)
|
||||
task.dockerIsActive.getOrElse(false)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue