2022-10-02 12:11:06 +02:00
|
|
|
import dev.adamko.geedeecee.DockerComposeExec
|
2021-12-26 22:55:06 +01:00
|
|
|
|
2021-12-01 16:57:46 +01:00
|
|
|
plugins {
|
2022-10-02 12:11:06 +02:00
|
|
|
id("dev.adamko.geedeecee")
|
2021-12-01 16:57:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
description = "Send events from a Factorio server to a Kafka topic "
|
|
|
|
|
|
2021-12-26 22:55:06 +01:00
|
|
|
|
2022-10-02 12:11:06 +02:00
|
|
|
//val dockerSrcDir: Directory by extra
|
2021-12-26 22:55:06 +01:00
|
|
|
|
2022-10-02 12:11:06 +02:00
|
|
|
tasks.dockerComposeUp {
|
2021-12-02 00:54:15 +01:00
|
|
|
dependsOn(":modules:infra-kafka-cluster:dockerUp")
|
|
|
|
|
}
|
2021-12-26 22:55:06 +01:00
|
|
|
|
|
|
|
|
|
2022-05-01 15:46:20 +02:00
|
|
|
val dockerBuildKafkaPipe by tasks.registering(DockerComposeExec::class) {
|
2021-12-26 22:55:06 +01:00
|
|
|
|
2022-10-02 12:11:06 +02:00
|
|
|
dockerComposeDir.set(geedeecee.srcDir)
|
2022-04-23 17:59:37 +02:00
|
|
|
command.set("docker-compose build kafka-pipe")
|
2021-12-26 22:55:06 +01:00
|
|
|
|
2022-04-23 17:59:37 +02:00
|
|
|
|
|
|
|
|
// inputs.property("dockerSrcDirChecksum") { dockerSrcDir.filesChecksum() }
|
|
|
|
|
//
|
|
|
|
|
// outputs.upToDateWhen {
|
|
|
|
|
// it.inputs.properties["dockerSrcDirChecksum"] as? Long? == dockerSrcDir.filesChecksum()
|
|
|
|
|
// }
|
2022-01-09 18:48:32 +01:00
|
|
|
|
|
|
|
|
// val imageIdFile = file("$temporaryDir/docker-image-id.txt")
|
|
|
|
|
// outputs.file(imageIdFile)
|
2022-01-09 18:05:28 +01:00
|
|
|
|
2022-04-23 17:59:37 +02:00
|
|
|
// workingDir = dockerSrcDir.asFile
|
|
|
|
|
// commandLine = parseSpaceSeparatedArgs(""" docker-compose build kafka-pipe """)
|
2022-01-09 18:05:28 +01:00
|
|
|
|
2022-01-09 18:48:32 +01:00
|
|
|
// doLast {
|
|
|
|
|
// sync {
|
|
|
|
|
// from(dockerSrcDir)
|
|
|
|
|
// into(temporaryDir)
|
|
|
|
|
// }
|
|
|
|
|
// imageIdFile.outputStream().use { os ->
|
|
|
|
|
// exec {
|
|
|
|
|
// workingDir = dockerSrcDir.asFile
|
|
|
|
|
// commandLine = parseSpaceSeparatedArgs(""" docker-compose images -q kafka-pipe """)
|
|
|
|
|
// standardOutput = os
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//}
|
2021-12-26 22:55:06 +01:00
|
|
|
}
|
2022-04-23 17:59:37 +02:00
|
|
|
|
2022-01-09 18:05:28 +01:00
|
|
|
tasks.assemble { dependsOn(dockerBuildKafkaPipe) }
|