1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
variable "GO_VERSION" {
default = null
}
variable "DESTDIR" {
default = "./bin"
}
group "default" {
targets = ["build"]
}
target "build" {
args = {
GO_VERSION = "${GO_VERSION}"
}
}
group "test" {
targets = ["test-root", "test-noroot"]
}
target "test-root" {
inherits = ["build"]
target = "test-coverage"
output = ["${DESTDIR}/coverage"]
}
target "test-noroot" {
inherits = ["build"]
target = "test-noroot-coverage"
output = ["${DESTDIR}/coverage"]
}
target "lint" {
dockerfile = "./hack/dockerfiles/lint.Dockerfile"
args = {
GO_VERSION = "${GO_VERSION}"
}
}
target "validate-gomod" {
dockerfile = "./hack/dockerfiles/gomod.Dockerfile"
target = "validate"
args = {
# go mod may produce different results between go versions,
# if this becomes a problem, this should be switched to use
# a fixed go version.
GO_VERSION = "${GO_VERSION}"
}
}
target "gomod" {
inherits = ["validate-gomod"]
output = ["."]
target = "update"
}
target "validate-shfmt" {
dockerfile = "./hack/dockerfiles/shfmt.Dockerfile"
target = "validate"
}
target "shfmt" {
inherits = ["validate-shfmt"]
output = ["."]
target = "update"
}
target "cross" {
inherits = ["build"]
platforms = ["linux/amd64", "linux/386", "linux/arm64", "linux/arm", "linux/ppc64le", "linux/s390x", "darwin/amd64", "darwin/arm64", "windows/amd64", "windows/arm64", "freebsd/amd64", "freebsd/arm64"]
}
|