Skip to content

Commit d78e250

Browse files
authored
Merge pull request #514 from crazy-max/bake-composable-attrs
bake: support composable attributes
2 parents 9c90456 + 068b0dc commit d78e250

File tree

8 files changed

+376
-143
lines changed

8 files changed

+376
-143
lines changed

__tests__/.fixtures/bake-01-overrides.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
"linux/amd64"
2323
],
2424
"output": [
25-
"type=docker"
25+
{
26+
"type": "docker"
27+
}
2628
]
2729
}
2830
}

__tests__/.fixtures/bake-01-validate.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
"GO_VERSION": "1.20"
2323
},
2424
"output": [
25-
"type=cacheonly"
25+
{
26+
"type": "cacheonly"
27+
}
2628
]
2729
},
2830
"validate-docs": {
@@ -36,7 +38,9 @@
3638
},
3739
"target": "validate",
3840
"output": [
39-
"type=cacheonly"
41+
{
42+
"type": "cacheonly"
43+
}
4044
]
4145
},
4246
"validate-vendor": {
@@ -48,7 +52,9 @@
4852
},
4953
"target": "validate",
5054
"output": [
51-
"type=cacheonly"
55+
{
56+
"type": "cacheonly"
57+
}
5258
]
5359
}
5460
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"target": {
3+
"default": {
4+
"context": ".",
5+
"dockerfile": "Dockerfile",
6+
"cache-from": [
7+
{
8+
"scope": "build",
9+
"type": "gha"
10+
},
11+
{
12+
"ref": "user/repo:cache",
13+
"type": "registry"
14+
}
15+
],
16+
"cache-to": [
17+
{
18+
"mode": "max",
19+
"scope": "build",
20+
"type": "gha"
21+
},
22+
{
23+
"type": "inline"
24+
}
25+
],
26+
"output": [
27+
{
28+
"dest": "./release-out",
29+
"type": "local"
30+
},
31+
{
32+
"ref": "user/app",
33+
"type": "registry"
34+
}
35+
]
36+
}
37+
}
38+
}

__tests__/.fixtures/bake-03.hcl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2024 actions-toolkit authors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
target "default" {
16+
cache-from = [
17+
"type=gha,scope=build",
18+
"user/repo:cache",
19+
]
20+
cache-to = [
21+
"type=gha,scope=build,mode=max",
22+
"type=inline"
23+
]
24+
output = [
25+
"./release-out",
26+
"type=registry,ref=user/app"
27+
]
28+
}

__tests__/.fixtures/bake-buildx-0.10.4-binaries-cross.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
"windows/arm64"
3030
],
3131
"output": [
32-
"./bin/build"
32+
{
33+
"dest": "./bin/build",
34+
"type": "local"
35+
}
3336
]
3437
}
3538
}

0 commit comments

Comments
 (0)