lenient Docker Env properties
This commit is contained in:
parent
deefafe255
commit
dd9c9500d3
2 changed files with 7 additions and 3 deletions
|
|
@ -25,6 +25,7 @@ abstract class DockerEnvUpdateTask @Inject constructor(
|
|||
) : DefaultTask() {
|
||||
|
||||
@get:Input
|
||||
@get:Optional
|
||||
abstract val envProperties: MapProperty<String, String>
|
||||
|
||||
@get:Input
|
||||
|
|
@ -50,10 +51,11 @@ abstract class DockerEnvUpdateTask @Inject constructor(
|
|||
val comment: String = comment.orNull
|
||||
?: " Do not edit manually. This file was created with task '$name'"
|
||||
|
||||
val envProperties = envProperties.getOrElse(emptyMap())
|
||||
|
||||
dotEnvFile.writer(charset).use { writer ->
|
||||
val properties = Properties()
|
||||
properties.putAll(envProperties.get())
|
||||
properties.putAll(envProperties)
|
||||
properties.store(writer, comment)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,13 +61,15 @@ tasks.dockerComposeUp {
|
|||
}
|
||||
|
||||
|
||||
val kafkatorioServerToken: String by project
|
||||
val kafkatorioServerToken: String? by project
|
||||
|
||||
|
||||
tasks.dockerComposeEnvUpdate {
|
||||
envProperties {
|
||||
put("FACTORIO_VERSION", libs.versions.factorio)
|
||||
put("KAFKATORIO_TOKEN", kafkatorioServerToken)
|
||||
kafkatorioServerToken?.let { token ->
|
||||
put("KAFKATORIO_TOKEN", token)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue