Skip to content

Commit

Permalink
bake: support composable attributes
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Nov 27, 2024
1 parent 670488c commit aa2455e
Show file tree
Hide file tree
Showing 8 changed files with 362 additions and 143 deletions.
4 changes: 3 additions & 1 deletion __tests__/.fixtures/bake-01-overrides.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"linux/amd64"
],
"output": [
"type=docker"
{
"type": "docker"
}
]
}
}
Expand Down
12 changes: 9 additions & 3 deletions __tests__/.fixtures/bake-01-validate.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"GO_VERSION": "1.20"
},
"output": [
"type=cacheonly"
{
"type": "cacheonly"
}
]
},
"validate-docs": {
Expand All @@ -36,7 +38,9 @@
},
"target": "validate",
"output": [
"type=cacheonly"
{
"type": "cacheonly"
}
]
},
"validate-vendor": {
Expand All @@ -48,7 +52,9 @@
},
"target": "validate",
"output": [
"type=cacheonly"
{
"type": "cacheonly"
}
]
}
}
Expand Down
38 changes: 38 additions & 0 deletions __tests__/.fixtures/bake-03-default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"target": {
"default": {
"context": ".",
"dockerfile": "Dockerfile",
"cache-from": [
{
"scope": "build",
"type": "gha"
},
{
"ref": "user/repo:cache",
"type": "registry"
}
],
"cache-to": [
{
"mode": "max",
"scope": "build",
"type": "gha"
},
{
"type": "inline"
}
],
"output": [
{
"dest": "./release-out",
"type": "local"
},
{
"ref": "user/app",
"type": "registry"
}
]
}
}
}
14 changes: 14 additions & 0 deletions __tests__/.fixtures/bake-03.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
target "default" {
cache-from = [
"type=gha,scope=build",
"user/repo:cache",
]
cache-to = [
"type=gha,scope=build,mode=max",
"type=inline"
]
output = [
"./release-out",
"type=registry,ref=user/app"
]
}
5 changes: 4 additions & 1 deletion __tests__/.fixtures/bake-buildx-0.10.4-binaries-cross.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
"windows/arm64"
],
"output": [
"./bin/build"
{
"dest": "./bin/build",
"type": "local"
}
]
}
}
Expand Down
Loading

0 comments on commit aa2455e

Please sign in to comment.