0
0
Fork 0
mirror of https://github.com/crazy-max/diun.git synced 2025-01-13 03:57:50 +00:00
crazy-max_diun/docker-bake.hcl
CrazyMax 1bc290cdf9
Set cacheonly output for validators (#395)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-06-02 22:26:26 +02:00

138 lines
2.4 KiB
HCL

// Go version
variable "GO_VERSION" {
default = "1.16"
}
target "go-version" {
args = {
GO_VERSION = GO_VERSION
}
}
// protoc version
variable "PROTOC_VERSION" {
default = "3.17.0"
}
target "protoc-version" {
args = {
PROTOC_VERSION = PROTOC_VERSION
}
}
// GitHub reference as defined in GitHub Actions (eg. refs/head/master))
variable "GITHUB_REF" {
default = ""
}
target "git-ref" {
args = {
GIT_REF = GITHUB_REF
}
}
// Special target: https://github.com/docker/metadata-action#bake-definition
target "docker-metadata-action" {
tags = ["crazymax/diun:local"]
}
group "default" {
targets = ["image-local"]
}
group "validate" {
targets = ["lint", "vendor-validate", "gen-validate"]
}
target "lint" {
inherits = ["go-version"]
dockerfile = "./hack/lint.Dockerfile"
target = "lint"
output = ["type=cacheonly"]
}
target "vendor-validate" {
inherits = ["go-version"]
dockerfile = "./hack/vendor.Dockerfile"
target = "validate"
output = ["type=cacheonly"]
}
target "vendor-update" {
inherits = ["go-version"]
dockerfile = "./hack/vendor.Dockerfile"
target = "update"
output = ["."]
}
target "gen-validate" {
inherits = ["go-version", "protoc-version"]
dockerfile = "./hack/gen.Dockerfile"
target = "validate"
output = ["type=cacheonly"]
}
target "gen-update" {
inherits = ["go-version", "protoc-version"]
dockerfile = "./hack/gen.Dockerfile"
target = "update"
output = ["."]
}
target "test" {
inherits = ["go-version"]
dockerfile = "./hack/test.Dockerfile"
target = "test-coverage"
output = ["."]
}
target "docs" {
dockerfile = "./hack/docs.Dockerfile"
target = "release"
output = ["./site"]
}
target "artifact" {
inherits = ["go-version", "git-ref"]
target = "artifacts"
output = ["./dist"]
}
target "artifact-all" {
inherits = ["artifact"]
platforms = [
"darwin/amd64",
"darwin/arm64",
"linux/amd64",
"linux/386",
"linux/arm/v5",
"linux/arm/v6",
"linux/arm/v7",
"linux/arm64",
"linux/ppc64le",
"linux/s390x",
"windows/amd64",
"windows/386"
]
}
target "image" {
inherits = ["go-version", "git-ref", "docker-metadata-action"]
}
target "image-local" {
inherits = ["image"]
output = ["type=docker"]
}
target "image-all" {
inherits = ["image"]
platforms = [
"linux/amd64",
"linux/386",
"linux/arm/v6",
"linux/arm/v7",
"linux/arm64",
"linux/ppc64le"
]
}