0
0
Fork 0
mirror of https://github.com/crazy-max/diun.git synced 2025-01-12 19:48:12 +00:00
crazy-max_diun/docker-bake.hcl
CrazyMax 3bbe883358
Refactor CI and dev workflow with buildx bake (#247)
* Upload artifacts
* Add image-local target
* Single job for artifacts and image
* Add armv5 artifact

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
2020-12-26 10:30:46 +00:00

88 lines
1.7 KiB
HCL

// Go version
variable "GO_VERSION" {
default = "1.15"
}
// GitHub reference as defined in GitHub Actions (eg. refs/head/master))
variable "GITHUB_REF" {
default = ""
}
target "go-version" {
args = {
GO_VERSION = GO_VERSION
}
}
// Special target: https://github.com/crazy-max/ghaction-docker-meta#bake-definition
target "ghaction-docker-meta" {
tags = ["crazymax/diun:local"]
}
group "default" {
targets = ["image-local"]
}
group "validate" {
targets = ["lint", "vendor-validate"]
}
target "lint" {
inherits = ["go-version"]
dockerfile = "./hack/lint.Dockerfile"
target = "lint"
}
target "vendor-validate" {
inherits = ["go-version"]
dockerfile = "./hack/vendor.Dockerfile"
target = "validate"
}
target "vendor-update" {
inherits = ["go-version"]
dockerfile = "./hack/vendor.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" {
args = {
GIT_REF = GITHUB_REF
}
inherits = ["go-version"]
target = "artifacts"
output = ["./dist"]
}
target "artifact-all" {
inherits = ["artifact"]
platforms = ["linux/amd64", "linux/arm/v5", "linux/arm/v6", "linux/arm/v7", "linux/arm64", "linux/386", "linux/ppc64le", "linux/s390x", "windows/amd64", "windows/386", "darwin/amd64"]
}
target "image" {
inherits = ["go-version", "ghaction-docker-meta"]
}
target "image-local" {
inherits = ["image"]
output = ["type=docker"]
}
target "image-all" {
inherits = ["image"]
platforms = ["linux/amd64", "linux/arm/v6", "linux/arm/v7", "linux/arm64", "linux/386", "linux/ppc64le"]
}