add common args bake target

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2021-12-07 20:07:21 +01:00
parent ae3b0b34c8
commit ede32747b5
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
1 changed files with 14 additions and 0 deletions

View File

@ -1,3 +1,6 @@
variable "GO_VERSION" {
default = "1.16.11"
}
variable "VERSION" {
default = ""
}
@ -16,11 +19,19 @@ variable "COMPANY_NAME" {
default = ""
}
target "_common" {
args = {
GO_VERSION = GO_VERSION
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
}
}
group "default" {
targets = ["binary"]
}
target "binary" {
inherits = ["_common"]
target = "binary"
platforms = ["local"]
output = ["build"]
@ -40,6 +51,7 @@ target "dynbinary" {
}
target "plugins" {
inherits = ["_common"]
target = "plugins"
platforms = ["local"]
output = ["build"]
@ -67,12 +79,14 @@ target "plugins-cross" {
}
target "lint" {
inherits = ["_common"]
dockerfile = "./dockerfiles/Dockerfile.lint"
target = "lint"
output = ["type=cacheonly"]
}
target "shellcheck" {
inherits = ["_common"]
dockerfile = "./dockerfiles/Dockerfile.shellcheck"
target = "shellcheck"
output = ["type=cacheonly"]