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 28, 2024
1 parent 2e6acb8 commit 8c24017
Show file tree
Hide file tree
Showing 8 changed files with 376 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"
}
]
}
}
}
28 changes: 28 additions & 0 deletions __tests__/.fixtures/bake-03.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2024 actions-toolkit authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

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 8c24017

Please sign in to comment.