2023-01-17 19:02:32 +08:00
|
|
|
group "default" {
|
|
|
|
targets = ["build"]
|
|
|
|
}
|
|
|
|
|
|
|
|
group "pre-checkin" {
|
2023-01-23 04:22:42 +08:00
|
|
|
targets = ["vendor", "format", "build"]
|
2023-01-17 19:02:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
group "validate" {
|
2023-01-31 10:33:48 +08:00
|
|
|
targets = ["lint", "vendor-validate", "license-validate"]
|
2023-01-17 19:02:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
target "build" {
|
|
|
|
dockerfile = "dev.Dockerfile"
|
|
|
|
target = "build-update"
|
|
|
|
output = ["."]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "format" {
|
|
|
|
dockerfile = "dev.Dockerfile"
|
|
|
|
target = "format-update"
|
|
|
|
output = ["."]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "lint" {
|
|
|
|
dockerfile = "dev.Dockerfile"
|
|
|
|
target = "lint"
|
|
|
|
output = ["type=cacheonly"]
|
|
|
|
}
|
|
|
|
|
2023-01-23 04:22:42 +08:00
|
|
|
target "vendor" {
|
2023-01-17 19:02:32 +08:00
|
|
|
dockerfile = "dev.Dockerfile"
|
|
|
|
target = "vendor-update"
|
|
|
|
output = ["."]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "vendor-validate" {
|
|
|
|
dockerfile = "dev.Dockerfile"
|
|
|
|
target = "vendor-validate"
|
|
|
|
output = ["type=cacheonly"]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "test" {
|
2023-01-23 08:38:28 +08:00
|
|
|
dockerfile = "dev.Dockerfile"
|
|
|
|
target = "test"
|
|
|
|
output = ["type=cacheonly"]
|
2023-01-24 07:29:03 +08:00
|
|
|
secret = ["id=GITHUB_TOKEN,env=GITHUB_TOKEN"]
|
2023-01-23 08:38:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
target "test-coverage" {
|
2023-01-17 19:02:32 +08:00
|
|
|
dockerfile = "dev.Dockerfile"
|
|
|
|
target = "test-coverage"
|
|
|
|
output = ["./coverage"]
|
2023-01-24 07:29:03 +08:00
|
|
|
secret = ["id=GITHUB_TOKEN,env=GITHUB_TOKEN"]
|
2023-01-17 19:02:32 +08:00
|
|
|
}
|
2023-01-30 18:15:39 +08:00
|
|
|
|
|
|
|
# GITHUB_REF is the actual ref that triggers the workflow and used as version
|
|
|
|
# when a tag is pushed: https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
|
|
|
|
variable "GITHUB_REF" {
|
|
|
|
default = ""
|
|
|
|
}
|
|
|
|
|
|
|
|
target "publish" {
|
|
|
|
dockerfile = "dev.Dockerfile"
|
|
|
|
args = {
|
|
|
|
GITHUB_REF = GITHUB_REF
|
|
|
|
}
|
|
|
|
target = "publish"
|
|
|
|
output = ["type=cacheonly"]
|
|
|
|
secret = ["id=NODE_AUTH_TOKEN,env=NODE_AUTH_TOKEN"]
|
|
|
|
}
|
2023-01-31 10:33:48 +08:00
|
|
|
|
|
|
|
target "license-validate" {
|
|
|
|
dockerfile = "./hack/dockerfiles/license.Dockerfile"
|
|
|
|
target = "validate"
|
|
|
|
output = ["type=cacheonly"]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "license-update" {
|
|
|
|
dockerfile = "./hack/dockerfiles/license.Dockerfile"
|
|
|
|
target = "update"
|
|
|
|
output = ["."]
|
|
|
|
}
|