io.bkbn.skelegro.docker.commands.Copy.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of skelegro-docker Show documentation
Show all versions of skelegro-docker Show documentation
A wacky assortment of Kotlin DSLs for infrastructure manifest generation
package io.bkbn.skelegro.docker.commands
import io.bkbn.skelegro.docker.Dockerfile
import io.bkbn.skelegro.docker.modify
open class Copy(
var fromStage: String? = null,
var from: String = ".",
var to: String = ".",
comment: String? = null
) : Command(comment) {
override fun tag() = "COPY"
// override fun toString() = "${tag()} ${fromStage.isNotBlank().let { "--from=$fromStage " }}$from $to"
override fun toString() = "${tag()} ${fromStage?.modify { fs -> "--from=$fs " } ?: ""}$from $to"
}
fun Dockerfile.COPY(init: Copy.() -> Unit): Copy {
val copy = Copy().apply(init)
steps.add(copy)
return copy
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy