Compare commits
136 Commits
v0.1.0-rc.
...
v0.8.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fcc92b092b | ||
|
|
6e043aee71 | ||
|
|
7a37a260aa | ||
|
|
1534dfad1b | ||
|
|
08e669e7d5 | ||
|
|
83d366eb65 | ||
|
|
5b760c8b3a | ||
|
|
674ee4994a | ||
|
|
a56ca8f880 | ||
|
|
b833243795 | ||
|
|
823d1cfce9 | ||
|
|
97bc88d30b | ||
|
|
ed4441e704 | ||
|
|
7a4b2122b2 | ||
|
|
959fb2fd2e | ||
|
|
2c0d9d0c4e | ||
|
|
3199bce461 | ||
|
|
f1593e3aa2 | ||
|
|
db5c712dec | ||
|
|
fd97af130e | ||
|
|
ec700a3813 | ||
|
|
324e807d2e | ||
|
|
8e45354f0c | ||
|
|
906aacf7ff | ||
|
|
1d9f94872d | ||
|
|
b99f9ec3ef | ||
|
|
8d02bad9a9 | ||
|
|
c1edd0b5e3 | ||
|
|
70c0e12f74 | ||
|
|
ddcd63c92a | ||
|
|
0e5fc3661a | ||
|
|
3d49d98580 | ||
|
|
ca519e1aa8 | ||
|
|
b13ef76b5e | ||
|
|
2043356c92 | ||
|
|
84371bb189 | ||
|
|
ad6e71b881 | ||
|
|
e47142d45b | ||
|
|
e79f79bcd9 | ||
|
|
ab02f62089 | ||
|
|
8cef70fefb | ||
|
|
321a028303 | ||
|
|
80eaf0972b | ||
|
|
101a44b0a7 | ||
|
|
22cc0b6c27 | ||
|
|
21fdfc52c4 | ||
|
|
eebb677d5a | ||
|
|
495c96b050 | ||
|
|
b1e0aeed50 | ||
|
|
d0ee813215 | ||
|
|
b2a51dd6b4 | ||
|
|
acd3c9df19 | ||
|
|
8ad595b445 | ||
|
|
9450a454a7 | ||
|
|
a7221012c8 | ||
|
|
6fc5565c73 | ||
|
|
7492c7193a | ||
|
|
f05a598a08 | ||
|
|
fc85cef9e1 | ||
|
|
a5b683b46e | ||
|
|
0b166c63ef | ||
|
|
e072607266 | ||
|
|
a1ffbe9606 | ||
|
|
fdd740da2d | ||
|
|
8a9577d5e2 | ||
|
|
ca7a29d2d7 | ||
|
|
d39585b339 | ||
|
|
2e3ba6678f | ||
|
|
337a7240a5 | ||
|
|
728fcdbea9 | ||
|
|
dfa1a320c4 | ||
|
|
4ff86b974f | ||
|
|
181782ba21 | ||
|
|
dd977d3597 | ||
|
|
776422c908 | ||
|
|
d86a125551 | ||
|
|
633f41191f | ||
|
|
79def6b218 | ||
|
|
31e5d12fd9 | ||
|
|
1eda4b6a6c | ||
|
|
c71f3fe1ba | ||
|
|
8c8294806e | ||
|
|
ec382328c4 | ||
|
|
051c91700a | ||
|
|
471068fc6f | ||
|
|
60feaf2f84 | ||
|
|
ec33a95de8 | ||
|
|
b45f7f151f | ||
|
|
0ad6a34d2a | ||
|
|
4445b1e4fc | ||
|
|
9cca84f1d8 | ||
|
|
cf39a26d01 | ||
|
|
3ebf172e37 | ||
|
|
dba2a69f61 | ||
|
|
dd07d9ea06 | ||
|
|
0af70ae7cf | ||
|
|
0f6ebcb798 | ||
|
|
3f543accc6 | ||
|
|
16bbae82de | ||
|
|
8b597ca8bc | ||
|
|
dc9c9bc2b7 | ||
|
|
63659873d5 | ||
|
|
6327a9b5dc | ||
|
|
50b16df20c | ||
|
|
0b1e18cfc2 | ||
|
|
741d2e1319 | ||
|
|
9e10ac6818 | ||
|
|
65f12dcfd0 | ||
|
|
46da20f01d | ||
|
|
0af3fda4f0 | ||
|
|
6179a5a445 | ||
|
|
26d9901f07 | ||
|
|
462c95e83d | ||
|
|
e185293749 | ||
|
|
2d1ce9a223 | ||
|
|
2d105f7337 | ||
|
|
5df47fe964 | ||
|
|
61527248dd | ||
|
|
210b7421e4 | ||
|
|
e9aa8365e3 | ||
|
|
85557d0e0d | ||
|
|
a7448298e0 | ||
|
|
d0929eeb16 | ||
|
|
da9600bbef | ||
|
|
70fba4e078 | ||
|
|
a89868cdc5 | ||
|
|
49bde5a54a | ||
|
|
4fcbf75fc4 | ||
|
|
314f8f431e | ||
|
|
7fb0476dc8 | ||
|
|
9b9ff70b75 | ||
|
|
e7eee6e401 | ||
|
|
b2fd32e0ef | ||
|
|
417136db1e | ||
|
|
e033e82024 | ||
|
|
b3328f5ec4 |
320
.github/buildx-releases.json
vendored
320
.github/buildx-releases.json
vendored
@@ -1,43 +1,289 @@
|
||||
{
|
||||
"latest": {
|
||||
"id": 94659464,
|
||||
"tag_name": "v0.10.4",
|
||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.10.4",
|
||||
"id": 112690624,
|
||||
"tag_name": "v0.11.2",
|
||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.11.2",
|
||||
"assets": [
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.darwin-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.darwin-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm-v6",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm-v7",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-ppc64le",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-riscv64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-s390x",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.4/checksums.txt"
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.darwin-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.darwin-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-arm-v6",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-arm-v7",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-ppc64le",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-riscv64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-s390x",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/checksums.txt"
|
||||
]
|
||||
},
|
||||
"v0.11.2": {
|
||||
"id": 112690624,
|
||||
"tag_name": "v0.11.2",
|
||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.11.2",
|
||||
"assets": [
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.darwin-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.darwin-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-arm-v6",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-arm-v7",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-ppc64le",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-riscv64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-s390x",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.2/checksums.txt"
|
||||
]
|
||||
},
|
||||
"v0.11.1": {
|
||||
"id": 111149999,
|
||||
"tag_name": "v0.11.1",
|
||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.11.1",
|
||||
"assets": [
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.darwin-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.darwin-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-arm-v6",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-arm-v7",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-ppc64le",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-riscv64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-s390x",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/buildx-v0.11.1.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.1/checksums.txt"
|
||||
]
|
||||
},
|
||||
"v0.11.0": {
|
||||
"id": 108385289,
|
||||
"tag_name": "v0.11.0",
|
||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.11.0",
|
||||
"assets": [
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.darwin-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.darwin-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-arm-v6",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-arm-v7",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-ppc64le",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-riscv64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-s390x",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0/checksums.txt"
|
||||
]
|
||||
},
|
||||
"v0.11.0-rc2": {
|
||||
"id": 107680036,
|
||||
"tag_name": "v0.11.0-rc2",
|
||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.11.0-rc2",
|
||||
"assets": [
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.darwin-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.darwin-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-arm-v6",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-arm-v7",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-ppc64le",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-riscv64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-s390x",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/buildx-v0.11.0-rc2.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc2/checksums.txt"
|
||||
]
|
||||
},
|
||||
"v0.10.5": {
|
||||
"id": 103872471,
|
||||
"tag_name": "v0.10.5",
|
||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.10.5",
|
||||
"assets": [
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.darwin-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.darwin-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-arm-v6",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-arm-v7",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-ppc64le",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-riscv64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-s390x",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/buildx-v0.10.5.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.10.5/checksums.txt"
|
||||
]
|
||||
},
|
||||
"v0.11.0-rc1": {
|
||||
"id": 102797153,
|
||||
"tag_name": "v0.11.0-rc1",
|
||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.11.0-rc1",
|
||||
"assets": [
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.darwin-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.darwin-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-arm-v6",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-arm-v7",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-ppc64le",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-riscv64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-s390x",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/buildx-v0.11.0-rc1.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.11.0-rc1/checksums.txt"
|
||||
]
|
||||
},
|
||||
"v0.10.4": {
|
||||
|
||||
1
.github/dependabot.yml
vendored
1
.github/dependabot.yml
vendored
@@ -11,6 +11,7 @@ updates:
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
versioning-strategy: "increase"
|
||||
allow:
|
||||
- dependency-type: "production"
|
||||
labels:
|
||||
|
||||
120
.github/docker-releases.json
vendored
120
.github/docker-releases.json
vendored
@@ -1,8 +1,122 @@
|
||||
{
|
||||
"latest": {
|
||||
"id": 91964526,
|
||||
"tag_name": "v23.0.1",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v23.0.1",
|
||||
"id": 113348684,
|
||||
"tag_name": "v24.0.5",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v24.0.5",
|
||||
"assets": []
|
||||
},
|
||||
"v24.0.5": {
|
||||
"id": 113348684,
|
||||
"tag_name": "v24.0.5",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v24.0.5",
|
||||
"assets": []
|
||||
},
|
||||
"v24.0.4": {
|
||||
"id": 111464537,
|
||||
"tag_name": "v24.0.4",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v24.0.4",
|
||||
"assets": []
|
||||
},
|
||||
"v24.0.3": {
|
||||
"id": 111300256,
|
||||
"tag_name": "v24.0.3",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v24.0.3",
|
||||
"assets": []
|
||||
},
|
||||
"v24.0.2": {
|
||||
"id": 104366762,
|
||||
"tag_name": "v24.0.2",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v24.0.2",
|
||||
"assets": []
|
||||
},
|
||||
"v24.0.1": {
|
||||
"id": 103671743,
|
||||
"tag_name": "v24.0.1",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v24.0.1",
|
||||
"assets": []
|
||||
},
|
||||
"v24.0.0": {
|
||||
"id": 103200193,
|
||||
"tag_name": "v24.0.0",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v24.0.0",
|
||||
"assets": []
|
||||
},
|
||||
"v20.10.25": {
|
||||
"id": 103070540,
|
||||
"tag_name": "v20.10.25",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.25",
|
||||
"assets": []
|
||||
},
|
||||
"v24.0.0-rc.4": {
|
||||
"id": 102846110,
|
||||
"tag_name": "v24.0.0-rc.4",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v24.0.0-rc.4",
|
||||
"assets": []
|
||||
},
|
||||
"v24.0.0-rc.3": {
|
||||
"id": 102708870,
|
||||
"tag_name": "v24.0.0-rc.3",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v24.0.0-rc.3",
|
||||
"assets": []
|
||||
},
|
||||
"v23.0.6": {
|
||||
"id": 102196340,
|
||||
"tag_name": "v23.0.6",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v23.0.6",
|
||||
"assets": []
|
||||
},
|
||||
"v24.0.0-rc.2": {
|
||||
"id": 102091676,
|
||||
"tag_name": "v24.0.0-rc.2",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v24.0.0-rc.2",
|
||||
"assets": []
|
||||
},
|
||||
"v24.0.0-rc.1": {
|
||||
"id": 101305950,
|
||||
"tag_name": "v24.0.0-rc.1",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v24.0.0-rc.1",
|
||||
"assets": []
|
||||
},
|
||||
"v23.0.5": {
|
||||
"id": 101005794,
|
||||
"tag_name": "v23.0.5",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v23.0.5",
|
||||
"assets": []
|
||||
},
|
||||
"v23.0.4": {
|
||||
"id": 99811576,
|
||||
"tag_name": "v23.0.4",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v23.0.4",
|
||||
"assets": []
|
||||
},
|
||||
"v24.0.0-beta.2": {
|
||||
"id": 99544545,
|
||||
"tag_name": "v24.0.0-beta.2",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v24.0.0-beta.2",
|
||||
"assets": []
|
||||
},
|
||||
"v23.0.3": {
|
||||
"id": 98122882,
|
||||
"tag_name": "v23.0.3",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v23.0.3",
|
||||
"assets": []
|
||||
},
|
||||
"v20.10.24": {
|
||||
"id": 98096018,
|
||||
"tag_name": "v20.10.24",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.24",
|
||||
"assets": []
|
||||
},
|
||||
"v24.0.0-beta.1": {
|
||||
"id": 97703002,
|
||||
"tag_name": "v24.0.0-beta.1",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v24.0.0-beta.1",
|
||||
"assets": []
|
||||
},
|
||||
"v23.0.2": {
|
||||
"id": 97163508,
|
||||
"tag_name": "v23.0.2",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v23.0.2",
|
||||
"assets": []
|
||||
},
|
||||
"v23.0.1": {
|
||||
|
||||
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@@ -1,5 +1,9 @@
|
||||
name: build
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -17,6 +21,6 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v2
|
||||
uses: docker/bake-action@v3
|
||||
with:
|
||||
targets: build
|
||||
|
||||
2
.github/workflows/buildx-releases-json.yml
vendored
2
.github/workflows/buildx-releases-json.yml
vendored
@@ -45,7 +45,7 @@ jobs:
|
||||
git add -A .
|
||||
-
|
||||
name: Create PR
|
||||
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04
|
||||
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
|
||||
with:
|
||||
base: main
|
||||
branch: bot/buildx-releases-json
|
||||
|
||||
2
.github/workflows/docker-releases-json.yml
vendored
2
.github/workflows/docker-releases-json.yml
vendored
@@ -45,7 +45,7 @@ jobs:
|
||||
git add -A .
|
||||
-
|
||||
name: Create PR
|
||||
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04
|
||||
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
|
||||
with:
|
||||
base: main
|
||||
branch: bot/docker-releases-json
|
||||
|
||||
45
.github/workflows/e2e.yml
vendored
45
.github/workflows/e2e.yml
vendored
@@ -1,45 +0,0 @@
|
||||
name: e2e
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '.github/*-releases.json'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
cache: 'yarn'
|
||||
-
|
||||
name: Install
|
||||
run: yarn install
|
||||
-
|
||||
name: Test
|
||||
run: yarn test-coverage:e2e --coverageDirectory=./coverage
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
-
|
||||
name: Upload coverage
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
file: ./coverage/clover.xml
|
||||
flags: e2e
|
||||
6
.github/workflows/publish.yml
vendored
6
.github/workflows/publish.yml
vendored
@@ -1,5 +1,9 @@
|
||||
name: publish
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
@@ -17,7 +21,7 @@ jobs:
|
||||
uses: docker/setup-buildx-action@v2
|
||||
-
|
||||
name: Publish
|
||||
uses: docker/bake-action@v2
|
||||
uses: docker/bake-action@v3
|
||||
with:
|
||||
targets: publish
|
||||
env:
|
||||
|
||||
99
.github/workflows/test.yml
vendored
99
.github/workflows/test.yml
vendored
@@ -1,6 +1,11 @@
|
||||
name: test
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
@@ -9,25 +14,6 @@ on:
|
||||
- '.github/*-releases.json'
|
||||
|
||||
jobs:
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target:
|
||||
- lint
|
||||
- vendor-validate
|
||||
- license-validate
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Validate
|
||||
uses: docker/bake-action@v2
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@@ -36,7 +22,7 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Test
|
||||
uses: docker/bake-action@v2
|
||||
uses: docker/bake-action@v3
|
||||
with:
|
||||
targets: test-coverage
|
||||
env:
|
||||
@@ -47,3 +33,76 @@ jobs:
|
||||
with:
|
||||
file: ./coverage/clover.xml
|
||||
flags: unit
|
||||
|
||||
prepare-itg:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.tests.outputs.matrix }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
cache: 'yarn'
|
||||
-
|
||||
name: Install
|
||||
run: yarn install
|
||||
-
|
||||
name: Create matrix
|
||||
id: tests
|
||||
run: |
|
||||
declare -a tests
|
||||
for test in $(yarn run test:itg-list); do
|
||||
tests+=("${test#$(pwd)/__tests__/}")
|
||||
done
|
||||
echo "matrix=$(echo ${tests[@]} | jq -cR 'split(" ")')" >>${GITHUB_OUTPUT}
|
||||
-
|
||||
name: Show matrix
|
||||
run: |
|
||||
echo ${{ steps.tests.outputs.matrix }}
|
||||
|
||||
test-itg:
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs:
|
||||
- prepare-itg
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
test: ${{ fromJson(needs.prepare-itg.outputs.matrix) }}
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
exclude:
|
||||
- os: macos-latest
|
||||
test: buildx/bake.test.itg.ts
|
||||
- os: windows-latest
|
||||
test: buildx/bake.test.itg.ts
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
cache: 'yarn'
|
||||
-
|
||||
name: Install
|
||||
run: yarn install
|
||||
-
|
||||
name: Test
|
||||
run: yarn test:itg-coverage --runTestsByPath __tests__/${{ matrix.test }} --coverageDirectory=./coverage
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
-
|
||||
name: Upload coverage
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
file: ./coverage/clover.xml
|
||||
flags: itg
|
||||
|
||||
47
.github/workflows/validate.yml
vendored
Normal file
47
.github/workflows/validate.yml
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
name: validate
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '.github/*-releases.json'
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
targets: ${{ steps.targets.outputs.matrix }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Matrix
|
||||
id: targets
|
||||
run: |
|
||||
echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT
|
||||
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- prepare
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Validate
|
||||
uses: docker/bake-action@v3
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
1
.github/workflows/virtual-env.yml
vendored
1
.github/workflows/virtual-env.yml
vendored
@@ -23,7 +23,6 @@ jobs:
|
||||
- ubuntu-latest
|
||||
- ubuntu-22.04
|
||||
- ubuntu-20.04
|
||||
- ubuntu-18.04
|
||||
steps:
|
||||
-
|
||||
name: File system
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
[](https://www.npmjs.com/package/@docker/actions-toolkit)
|
||||
[](https://github.com/docker/actions-toolkit/actions?workflow=build)
|
||||
[](https://github.com/docker/actions-toolkit/actions?workflow=test)
|
||||
[](https://github.com/docker/actions-toolkit/actions?workflow=e2e)
|
||||
[](https://github.com/docker/actions-toolkit/actions?workflow=validate)
|
||||
[](https://codecov.io/gh/docker/actions-toolkit)
|
||||
|
||||
# Actions Toolkit
|
||||
|
||||
@@ -59,7 +59,7 @@ describe('resolve', () => {
|
||||
`,
|
||||
null
|
||||
]
|
||||
])('given %p config', async (val, file, exValue, error: Error) => {
|
||||
])('given %p config', async (val: string, file: boolean, exValue: string, error: Error | null) => {
|
||||
try {
|
||||
const buildkit = new BuildKit();
|
||||
let config: string;
|
||||
|
||||
43
__tests__/buildx/bake.test.itg.ts
Normal file
43
__tests__/buildx/bake.test.itg.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Copyright 2023 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.
|
||||
*/
|
||||
|
||||
import {beforeEach, describe, expect, jest, test} from '@jest/globals';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
import {Bake} from '../../src/buildx/bake';
|
||||
import {BakeDefinition} from '../../src/types/bake';
|
||||
|
||||
const fixturesDir = path.join(__dirname, '..', 'fixtures');
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
describe('parseDefinitions', () => {
|
||||
// prettier-ignore
|
||||
test.each([
|
||||
[
|
||||
['https://github.com/docker/buildx.git#v0.10.4'],
|
||||
['binaries-cross'],
|
||||
path.join(fixturesDir, 'bake-buildx-0.10.4-binaries-cross.json')
|
||||
]
|
||||
])('given %p', async (sources: string[], targets: string[], out: string) => {
|
||||
const bake = new Bake();
|
||||
const expectedDef = <BakeDefinition>JSON.parse(fs.readFileSync(out, {encoding: 'utf-8'}).trim())
|
||||
expect(await bake.parseDefinitions(sources, targets)).toEqual(expectedDef);
|
||||
});
|
||||
});
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import {beforeEach, describe, expect, jest, test} from '@jest/globals';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
import {Bake} from '../../src/buildx/bake';
|
||||
@@ -30,67 +31,27 @@ describe('parseDefinitions', () => {
|
||||
// prettier-ignore
|
||||
test.each([
|
||||
[
|
||||
[path.join(fixturesDir, 'bake.hcl')],
|
||||
[path.join(fixturesDir, 'bake-01.hcl')],
|
||||
['validate'],
|
||||
{
|
||||
"group": {
|
||||
"default": {
|
||||
"targets": [
|
||||
"validate"
|
||||
]
|
||||
},
|
||||
"validate": {
|
||||
"targets": [
|
||||
"lint",
|
||||
"validate-vendor",
|
||||
"validate-docs"
|
||||
]
|
||||
}
|
||||
},
|
||||
"target": {
|
||||
"lint": {
|
||||
"context": ".",
|
||||
"dockerfile": "./hack/dockerfiles/lint.Dockerfile",
|
||||
"args": {
|
||||
"BUILDKIT_CONTEXT_KEEP_GIT_DIR": "1",
|
||||
"GO_VERSION": "1.20"
|
||||
},
|
||||
"output": [
|
||||
"type=cacheonly"
|
||||
]
|
||||
},
|
||||
"validate-docs": {
|
||||
"context": ".",
|
||||
"dockerfile": "./hack/dockerfiles/docs.Dockerfile",
|
||||
"args": {
|
||||
"BUILDKIT_CONTEXT_KEEP_GIT_DIR": "1",
|
||||
"BUILDX_EXPERIMENTAL": "1",
|
||||
"FORMATS": "md",
|
||||
"GO_VERSION": "1.20"
|
||||
},
|
||||
"target": "validate",
|
||||
"output": [
|
||||
"type=cacheonly"
|
||||
]
|
||||
},
|
||||
"validate-vendor": {
|
||||
"context": ".",
|
||||
"dockerfile": "./hack/dockerfiles/vendor.Dockerfile",
|
||||
"args": {
|
||||
"BUILDKIT_CONTEXT_KEEP_GIT_DIR": "1",
|
||||
"GO_VERSION": "1.20"
|
||||
},
|
||||
"target": "validate",
|
||||
"output": [
|
||||
"type=cacheonly"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
[],
|
||||
path.join(fixturesDir, 'bake-01-validate.json')
|
||||
],
|
||||
[
|
||||
[path.join(fixturesDir, 'bake-02.hcl')],
|
||||
['build'],
|
||||
[],
|
||||
path.join(fixturesDir, 'bake-02-build.json')
|
||||
],
|
||||
[
|
||||
[path.join(fixturesDir, 'bake-01.hcl')],
|
||||
['image'],
|
||||
['*.output=type=docker', '*.platform=linux/amd64'],
|
||||
path.join(fixturesDir, 'bake-01-overrides.json')
|
||||
]
|
||||
])('given %p', async (files, targets, expected: BakeDefinition) => {
|
||||
])('given %p', async (sources: string[], targets: string[], overrides: string[], out: string) => {
|
||||
const bake = new Bake();
|
||||
expect(await bake.parseDefinitions(files, targets)).toEqual(expected);
|
||||
const expectedDef = <BakeDefinition>JSON.parse(fs.readFileSync(out, {encoding: 'utf-8'}).trim())
|
||||
expect(await bake.parseDefinitions(sources, targets, overrides)).toEqual(expectedDef);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -106,7 +67,17 @@ describe('hasLocalExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false
|
||||
],
|
||||
[
|
||||
{
|
||||
"target": {
|
||||
"build": {
|
||||
"target": "build"
|
||||
},
|
||||
}
|
||||
} as unknown as BakeDefinition,
|
||||
false
|
||||
],
|
||||
[
|
||||
@@ -118,7 +89,7 @@ describe('hasLocalExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true
|
||||
],
|
||||
[
|
||||
@@ -130,7 +101,7 @@ describe('hasLocalExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false
|
||||
],
|
||||
[
|
||||
@@ -142,7 +113,7 @@ describe('hasLocalExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false
|
||||
],
|
||||
[
|
||||
@@ -154,7 +125,7 @@ describe('hasLocalExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true
|
||||
],
|
||||
[
|
||||
@@ -166,7 +137,7 @@ describe('hasLocalExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true
|
||||
]
|
||||
])('given %o returns %p', async (def: BakeDefinition, expected: boolean) => {
|
||||
@@ -186,7 +157,7 @@ describe('hasTarExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false
|
||||
],
|
||||
[
|
||||
@@ -198,7 +169,7 @@ describe('hasTarExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false
|
||||
],
|
||||
[
|
||||
@@ -210,7 +181,7 @@ describe('hasTarExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false
|
||||
],
|
||||
[
|
||||
@@ -222,7 +193,7 @@ describe('hasTarExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true
|
||||
],
|
||||
[
|
||||
@@ -235,7 +206,7 @@ describe('hasTarExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true
|
||||
],
|
||||
[
|
||||
@@ -247,7 +218,7 @@ describe('hasTarExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true
|
||||
],
|
||||
[
|
||||
@@ -259,7 +230,7 @@ describe('hasTarExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false
|
||||
],
|
||||
[
|
||||
@@ -271,7 +242,7 @@ describe('hasTarExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false
|
||||
],
|
||||
])('given %o returns %p', async (def: BakeDefinition, expected: boolean) => {
|
||||
@@ -291,7 +262,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false,
|
||||
undefined
|
||||
],
|
||||
@@ -304,7 +275,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true,
|
||||
undefined
|
||||
],
|
||||
@@ -318,7 +289,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true,
|
||||
undefined
|
||||
],
|
||||
@@ -331,7 +302,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false,
|
||||
undefined
|
||||
],
|
||||
@@ -344,7 +315,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false,
|
||||
undefined
|
||||
],
|
||||
@@ -357,7 +328,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false,
|
||||
undefined
|
||||
],
|
||||
@@ -371,7 +342,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true,
|
||||
undefined
|
||||
],
|
||||
@@ -384,7 +355,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false,
|
||||
undefined
|
||||
],
|
||||
@@ -397,7 +368,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false,
|
||||
undefined
|
||||
],
|
||||
@@ -410,7 +381,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false,
|
||||
undefined
|
||||
],
|
||||
@@ -423,7 +394,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true,
|
||||
false
|
||||
],
|
||||
@@ -436,7 +407,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true,
|
||||
true
|
||||
],
|
||||
@@ -449,11 +420,11 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true,
|
||||
true
|
||||
],
|
||||
])('given %o and load:%p returns %p', async (def: BakeDefinition, expected: boolean, load: boolean) => {
|
||||
])('given %o and load:%p returns %p', async (def: BakeDefinition, expected: boolean, load: boolean | undefined) => {
|
||||
expect(Bake.hasDockerExporter(def, load)).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -210,6 +210,189 @@ describe('parseInspect', () => {
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
'inspect8.txt',
|
||||
{
|
||||
"name": "builder-52aa0611-faf0-42ac-a940-461e4e287d68",
|
||||
"driver": "docker-container",
|
||||
"lastActivity": new Date("2023-06-13T13:52:31.000Z"),
|
||||
"nodes": [
|
||||
{
|
||||
"buildkit": "v0.11.6",
|
||||
"buildkitd-flags": "--debug --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host",
|
||||
"driver-opts": [
|
||||
"image=moby/buildkit:buildx-stable-1",
|
||||
"network=host",
|
||||
],
|
||||
"endpoint": "unix:///var/run/docker.sock",
|
||||
"name": "builder-52aa0611-faf0-42ac-a940-461e4e287d680",
|
||||
"platforms": "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/amd64/v4,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6",
|
||||
"status": "running",
|
||||
"labels": {
|
||||
"org.mobyproject.buildkit.worker.executor": "oci",
|
||||
"org.mobyproject.buildkit.worker.hostname": "fv-az572-38",
|
||||
"org.mobyproject.buildkit.worker.network": "host",
|
||||
"org.mobyproject.buildkit.worker.oci.process-mode": "sandbox",
|
||||
"org.mobyproject.buildkit.worker.selinux.enabled": "false",
|
||||
"org.mobyproject.buildkit.worker.snapshotter": "overlayfs",
|
||||
},
|
||||
"gcPolicy": [
|
||||
{
|
||||
"all": false,
|
||||
"filter": [
|
||||
"type==source.local",
|
||||
"type==exec.cachemount",
|
||||
"type==source.git.checkout"
|
||||
],
|
||||
"keepDuration": "48h0m0s",
|
||||
"keepBytes": "488.3MiB",
|
||||
},
|
||||
{
|
||||
"all": false,
|
||||
"keepDuration": "1440h0m0s",
|
||||
"keepBytes": "8.382GiB",
|
||||
},
|
||||
{
|
||||
"all": false,
|
||||
"keepBytes": "8.382GiB",
|
||||
},
|
||||
{
|
||||
"all": true,
|
||||
"keepBytes": "8.382GiB",
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
'inspect9.txt',
|
||||
{
|
||||
"name": "default",
|
||||
"driver": "docker",
|
||||
"lastActivity": new Date("2023-06-13T18:13:43.000Z"),
|
||||
"nodes": [
|
||||
{
|
||||
"buildkit": "v0.11.7-0.20230525183624-798ad6b0ce9f",
|
||||
"endpoint": "default",
|
||||
"name": "default",
|
||||
"platforms": "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6",
|
||||
"status": "running",
|
||||
"gcPolicy": [
|
||||
{
|
||||
"all": true,
|
||||
"keepBytes": "100GiB",
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
'inspect10.txt',
|
||||
{
|
||||
"name": "remote-builder",
|
||||
"driver": "remote",
|
||||
"lastActivity": new Date("2023-04-20T12:47:49.000Z"),
|
||||
"nodes": [
|
||||
{
|
||||
"name": "remote-builder0",
|
||||
"endpoint": "docker-container://buildx_buildkit_dk-remote-builder0",
|
||||
"status": "inactive"
|
||||
},
|
||||
{
|
||||
"name": "aws_graviton2",
|
||||
"endpoint": "tcp://10.0.0.1:1234",
|
||||
"driver-opts": [
|
||||
"cacert=/home/user/.certs/aws_graviton2/ca.pem",
|
||||
"cert=/home/user/.certs/aws_graviton2/cert.pem",
|
||||
"key=/home/user/.certs/aws_graviton2/key.pem"
|
||||
],
|
||||
"status": "running",
|
||||
"buildkit": "v0.11.6",
|
||||
"platforms": "darwin/arm64,linux/arm64,linux/arm/v5,linux/arm/v6,linux/arm/v7,windows/arm64",
|
||||
"labels": {
|
||||
"org.mobyproject.buildkit.worker.executor": "oci",
|
||||
"org.mobyproject.buildkit.worker.hostname": "77ebc22e2d82",
|
||||
"org.mobyproject.buildkit.worker.network": "host",
|
||||
"org.mobyproject.buildkit.worker.oci.process-mode": "sandbox",
|
||||
"org.mobyproject.buildkit.worker.selinux.enabled": "false",
|
||||
"org.mobyproject.buildkit.worker.snapshotter": "overlayfs"
|
||||
},
|
||||
"gcPolicy": [
|
||||
{
|
||||
"all": false,
|
||||
"filter": [
|
||||
"type==source.local",
|
||||
"type==exec.cachemount",
|
||||
"type==source.git.checkout"
|
||||
],
|
||||
"keepDuration": "48h0m0s",
|
||||
"keepBytes": "488.3MiB"
|
||||
},
|
||||
{
|
||||
"all": false,
|
||||
"keepDuration": "1440h0m0s",
|
||||
"keepBytes": "23.28GiB"
|
||||
},
|
||||
{
|
||||
"all": false,
|
||||
"keepBytes": "23.28GiB"
|
||||
},
|
||||
{
|
||||
"all": true,
|
||||
"keepBytes": "23.28GiB"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "linuxone_s390x",
|
||||
"endpoint": "tcp://10.0.0.2:1234",
|
||||
"driver-opts": [
|
||||
"cacert=/home/user/.certs/linuxone_s390x/ca.pem",
|
||||
"cert=/home/user/.certs/linuxone_s390x/cert.pem",
|
||||
"key=/home/user/.certs/linuxone_s390x/key.pem"
|
||||
],
|
||||
"status": "running",
|
||||
"buildkit": "v0.11.6",
|
||||
"platforms": "linux/s390x",
|
||||
"labels": {
|
||||
"org.mobyproject.buildkit.worker.executor": "oci",
|
||||
"org.mobyproject.buildkit.worker.hostname": "9d0d62a96818",
|
||||
"org.mobyproject.buildkit.worker.network": "host",
|
||||
"org.mobyproject.buildkit.worker.oci.process-mode": "sandbox",
|
||||
"org.mobyproject.buildkit.worker.selinux.enabled": "false",
|
||||
"org.mobyproject.buildkit.worker.snapshotter": "overlayfs"
|
||||
},
|
||||
"gcPolicy": [
|
||||
{
|
||||
"all": false,
|
||||
"keepBytes": "488.3MiB",
|
||||
"filter": [
|
||||
"type==source.local",
|
||||
"type==exec.cachemount",
|
||||
"type==source.git.checkout"
|
||||
],
|
||||
"keepDuration": "48h0m0s"
|
||||
},
|
||||
{
|
||||
"all": false,
|
||||
"keepDuration": "1440h0m0s",
|
||||
"keepBytes": "9.313GiB"
|
||||
},
|
||||
{
|
||||
"all": false,
|
||||
"keepBytes": "9.313GiB"
|
||||
},
|
||||
{
|
||||
"all": true,
|
||||
"keepBytes": "9.313GiB"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
}
|
||||
]
|
||||
])('given %p', async (inspectFile, expected) => {
|
||||
expect(await Builder.parseInspect(fs.readFileSync(path.join(fixturesDir, inspectFile)).toString())).toEqual(expected);
|
||||
|
||||
@@ -162,7 +162,7 @@ describe('resolveBuildSecret', () => {
|
||||
['=bbbbbbb', false, '', '', new Error('=bbbbbbb is not a valid secret')],
|
||||
[`foo=${path.join(fixturesDir, 'secret.txt')}`, true, 'foo', 'bar', null],
|
||||
[`notfound=secret`, true, '', '', new Error('secret file secret not found')]
|
||||
])('given %p key and %p secret', async (kvp: string, file: boolean, exKey: string, exValue: string, error: Error) => {
|
||||
])('given %p key and %p secret', async (kvp: string, file: boolean, exKey: string, exValue: string, error: Error | null) => {
|
||||
try {
|
||||
let secret: string;
|
||||
if (file) {
|
||||
@@ -177,6 +177,21 @@ describe('resolveBuildSecret', () => {
|
||||
expect(e.message).toEqual(error?.message);
|
||||
}
|
||||
});
|
||||
|
||||
test.each([
|
||||
['FOO=bar', 'FOO', 'bar', null],
|
||||
['FOO=', 'FOO', '', new Error('FOO= is not a valid secret')],
|
||||
['=bar', '', '', new Error('=bar is not a valid secret')],
|
||||
['FOO=bar=baz', 'FOO', 'bar=baz', null]
|
||||
])('given %p key and %p env', async (kvp: string, exKey: string, exValue: string, error: Error | null) => {
|
||||
try {
|
||||
const secret = Inputs.resolveBuildSecretEnv(kvp);
|
||||
expect(secret).toEqual(`id=${exKey},env="${exValue}"`);
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line jest/no-conditional-expect
|
||||
expect(e.message).toEqual(error?.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('hasLocalExporter', () => {
|
||||
|
||||
@@ -36,9 +36,8 @@ afterEach(function () {
|
||||
describe('download', () => {
|
||||
// prettier-ignore
|
||||
test.each([
|
||||
['v0.9.1', false],
|
||||
['latest', false],
|
||||
['v0.9.1', true],
|
||||
['v0.9.0', false],
|
||||
['v0.10.5', true],
|
||||
['latest', true]
|
||||
])(
|
||||
'acquires %p of buildx (standalone: %p)', async (version, standalone) => {
|
||||
@@ -56,6 +55,18 @@ describe('download', () => {
|
||||
100000
|
||||
);
|
||||
|
||||
// prettier-ignore
|
||||
test.each([
|
||||
// following versions are already cached to htc from previous test cases
|
||||
['v0.9.0'],
|
||||
['v0.10.5'],
|
||||
])(
|
||||
'acquires %p of buildx with cache', async (version) => {
|
||||
const install = new Install({standalone: false});
|
||||
const toolPath = await install.download(version);
|
||||
expect(fs.existsSync(toolPath)).toBe(true);
|
||||
});
|
||||
|
||||
// TODO: add tests for arm
|
||||
// prettier-ignore
|
||||
test.each([
|
||||
@@ -69,7 +80,7 @@ describe('download', () => {
|
||||
['linux', 's390x'],
|
||||
])(
|
||||
'acquires buildx for %s/%s', async (os, arch) => {
|
||||
jest.spyOn(osm, 'platform').mockImplementation(() => os);
|
||||
jest.spyOn(osm, 'platform').mockImplementation(() => os as NodeJS.Platform);
|
||||
jest.spyOn(osm, 'arch').mockImplementation(() => arch);
|
||||
const install = new Install();
|
||||
const buildxBin = await install.download('latest');
|
||||
@@ -129,6 +140,6 @@ describe('getRelease', () => {
|
||||
});
|
||||
|
||||
it('unknown release', async () => {
|
||||
await expect(Install.getRelease('foo')).rejects.toThrowError(new Error('Cannot find Buildx release foo in https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/buildx-releases.json'));
|
||||
await expect(Install.getRelease('foo')).rejects.toThrow(new Error('Cannot find Buildx release foo in https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/buildx-releases.json'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -15,17 +15,30 @@
|
||||
*/
|
||||
|
||||
import {afterEach, beforeEach, describe, expect, it, jest} from '@jest/globals';
|
||||
import * as fs from 'fs';
|
||||
import path from 'path';
|
||||
import * as io from '@actions/io';
|
||||
import osm = require('os');
|
||||
import * as rimraf from 'rimraf';
|
||||
|
||||
import {Docker} from '../../src/docker/docker';
|
||||
import {Exec} from '../../src/exec';
|
||||
|
||||
import {ConfigFile} from '../../src/types/docker';
|
||||
|
||||
const fixturesDir = path.join(__dirname, '..', 'fixtures');
|
||||
|
||||
// prettier-ignore
|
||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'docker-jest');
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
rimraf.sync(tmpDir);
|
||||
});
|
||||
|
||||
describe('configDir', () => {
|
||||
const originalEnv = process.env;
|
||||
beforeEach(() => {
|
||||
@@ -48,6 +61,45 @@ describe('configDir', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('configFile', () => {
|
||||
const originalEnv = process.env;
|
||||
beforeEach(() => {
|
||||
jest.resetModules();
|
||||
if (!fs.existsSync(tmpDir)) {
|
||||
fs.mkdirSync(tmpDir, {recursive: true});
|
||||
}
|
||||
process.env = {
|
||||
...originalEnv,
|
||||
DOCKER_CONFIG: tmpDir
|
||||
};
|
||||
});
|
||||
afterEach(() => {
|
||||
process.env = originalEnv;
|
||||
});
|
||||
it('auths', async () => {
|
||||
fs.copyFileSync(path.join(fixturesDir, 'docker-config-auths.json'), path.join(tmpDir, 'config.json'));
|
||||
expect(Docker.configFile()).toEqual({
|
||||
auths: {
|
||||
'https://index.docker.io/v1/': {
|
||||
auth: 'am9lam9lOmhlbGxv',
|
||||
email: 'user@example.com'
|
||||
}
|
||||
}
|
||||
} as unknown as ConfigFile);
|
||||
});
|
||||
it('proxies', async () => {
|
||||
fs.copyFileSync(path.join(fixturesDir, 'docker-config-proxies.json'), path.join(tmpDir, 'config.json'));
|
||||
expect(Docker.configFile()).toEqual({
|
||||
proxies: {
|
||||
default: {
|
||||
httpProxy: 'http://127.0.0.1:3128',
|
||||
httpsProxy: 'http://127.0.0.1:3128'
|
||||
}
|
||||
}
|
||||
} as unknown as ConfigFile);
|
||||
});
|
||||
});
|
||||
|
||||
describe('isAvailable', () => {
|
||||
it('cli', async () => {
|
||||
const ioWhichSpy = jest.spyOn(io, 'which');
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import path from 'path';
|
||||
import {describe, expect, test} from '@jest/globals';
|
||||
import {jest, describe, expect, test} from '@jest/globals';
|
||||
|
||||
import {Install} from '../../src/docker/install';
|
||||
import {Docker} from '../../src/docker/docker';
|
||||
@@ -24,6 +24,7 @@ import {Docker} from '../../src/docker/docker';
|
||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'docker-install-jest');
|
||||
|
||||
describe('install', () => {
|
||||
jest.retryTimes(2, {logErrorsBeforeRetry: true});
|
||||
// prettier-ignore
|
||||
test.each(['v23.0.0'])(
|
||||
'install docker %s', async (version) => {
|
||||
@@ -42,7 +42,7 @@ describe('download', () => {
|
||||
['v20.10.22', 'win32'],
|
||||
])(
|
||||
'acquires %p of docker (%s)', async (version, platformOS) => {
|
||||
jest.spyOn(osm, 'platform').mockImplementation(() => platformOS);
|
||||
jest.spyOn(osm, 'platform').mockImplementation(() => platformOS as NodeJS.Platform);
|
||||
const install = new Install({
|
||||
version: version,
|
||||
runDir: tmpDir,
|
||||
@@ -68,6 +68,6 @@ describe('getRelease', () => {
|
||||
});
|
||||
|
||||
it('unknown release', async () => {
|
||||
await expect(Install.getRelease('foo')).rejects.toThrowError(new Error('Cannot find Docker release foo in https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/docker-releases.json'));
|
||||
await expect(Install.getRelease('foo')).rejects.toThrow(new Error('Cannot find Docker release foo in https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/docker-releases.json'));
|
||||
});
|
||||
});
|
||||
|
||||
29
__tests__/fixtures/bake-01-overrides.json
Normal file
29
__tests__/fixtures/bake-01-overrides.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"group": {
|
||||
"default": {
|
||||
"targets": [
|
||||
"image"
|
||||
]
|
||||
}
|
||||
},
|
||||
"target": {
|
||||
"image": {
|
||||
"context": ".",
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
"BUILDKIT_CONTEXT_KEEP_GIT_DIR": "1",
|
||||
"GO_VERSION": "1.20"
|
||||
},
|
||||
"tags": [
|
||||
"docker/buildx-bin:local"
|
||||
],
|
||||
"target": "binaries",
|
||||
"platforms": [
|
||||
"linux/amd64"
|
||||
],
|
||||
"output": [
|
||||
"type=docker"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
55
__tests__/fixtures/bake-01-validate.json
Normal file
55
__tests__/fixtures/bake-01-validate.json
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"group": {
|
||||
"default": {
|
||||
"targets": [
|
||||
"validate"
|
||||
]
|
||||
},
|
||||
"validate": {
|
||||
"targets": [
|
||||
"lint",
|
||||
"validate-vendor",
|
||||
"validate-docs"
|
||||
]
|
||||
}
|
||||
},
|
||||
"target": {
|
||||
"lint": {
|
||||
"context": ".",
|
||||
"dockerfile": "./hack/dockerfiles/lint.Dockerfile",
|
||||
"args": {
|
||||
"BUILDKIT_CONTEXT_KEEP_GIT_DIR": "1",
|
||||
"GO_VERSION": "1.20"
|
||||
},
|
||||
"output": [
|
||||
"type=cacheonly"
|
||||
]
|
||||
},
|
||||
"validate-docs": {
|
||||
"context": ".",
|
||||
"dockerfile": "./hack/dockerfiles/docs.Dockerfile",
|
||||
"args": {
|
||||
"BUILDKIT_CONTEXT_KEEP_GIT_DIR": "1",
|
||||
"BUILDX_EXPERIMENTAL": "1",
|
||||
"FORMATS": "md",
|
||||
"GO_VERSION": "1.20"
|
||||
},
|
||||
"target": "validate",
|
||||
"output": [
|
||||
"type=cacheonly"
|
||||
]
|
||||
},
|
||||
"validate-vendor": {
|
||||
"context": ".",
|
||||
"dockerfile": "./hack/dockerfiles/vendor.Dockerfile",
|
||||
"args": {
|
||||
"BUILDKIT_CONTEXT_KEEP_GIT_DIR": "1",
|
||||
"GO_VERSION": "1.20"
|
||||
},
|
||||
"target": "validate",
|
||||
"output": [
|
||||
"type=cacheonly"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
20
__tests__/fixtures/bake-02-build.json
Normal file
20
__tests__/fixtures/bake-02-build.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"group": {
|
||||
"default": {
|
||||
"targets": [
|
||||
"build"
|
||||
]
|
||||
}
|
||||
},
|
||||
"target": {
|
||||
"build": {
|
||||
"context": ".",
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
"BUILDKIT_CONTEXT_KEEP_GIT_DIR": "1",
|
||||
"GO_VERSION": "1.20"
|
||||
},
|
||||
"target": "build"
|
||||
}
|
||||
}
|
||||
}
|
||||
33
__tests__/fixtures/bake-02.hcl
Normal file
33
__tests__/fixtures/bake-02.hcl
Normal file
@@ -0,0 +1,33 @@
|
||||
// Copyright 2023 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.
|
||||
|
||||
variable "GO_VERSION" {
|
||||
default = "1.20"
|
||||
}
|
||||
|
||||
target "_common" {
|
||||
args = {
|
||||
GO_VERSION = GO_VERSION
|
||||
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
|
||||
}
|
||||
}
|
||||
|
||||
group "default" {
|
||||
targets = ["build"]
|
||||
}
|
||||
|
||||
target "build" {
|
||||
inherits = ["_common"]
|
||||
target = "build"
|
||||
}
|
||||
36
__tests__/fixtures/bake-buildx-0.10.4-binaries-cross.json
Normal file
36
__tests__/fixtures/bake-buildx-0.10.4-binaries-cross.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"group": {
|
||||
"default": {
|
||||
"targets": [
|
||||
"binaries-cross"
|
||||
]
|
||||
}
|
||||
},
|
||||
"target": {
|
||||
"binaries-cross": {
|
||||
"context": "https://github.com/docker/buildx.git#v0.10.4",
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
"BUILDKIT_CONTEXT_KEEP_GIT_DIR": "1",
|
||||
"GO_VERSION": "1.19"
|
||||
},
|
||||
"target": "binaries",
|
||||
"platforms": [
|
||||
"darwin/amd64",
|
||||
"darwin/arm64",
|
||||
"linux/amd64",
|
||||
"linux/arm/v6",
|
||||
"linux/arm/v7",
|
||||
"linux/arm64",
|
||||
"linux/ppc64le",
|
||||
"linux/riscv64",
|
||||
"linux/s390x",
|
||||
"windows/amd64",
|
||||
"windows/arm64"
|
||||
],
|
||||
"output": [
|
||||
"./bin/build"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
8
__tests__/fixtures/docker-config-auths.json
Normal file
8
__tests__/fixtures/docker-config-auths.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"auths": {
|
||||
"https://index.docker.io/v1/": {
|
||||
"auth": "am9lam9lOmhlbGxv",
|
||||
"email": "user@example.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
8
__tests__/fixtures/docker-config-proxies.json
Normal file
8
__tests__/fixtures/docker-config-proxies.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"proxies": {
|
||||
"default": {
|
||||
"httpProxy": "http://127.0.0.1:3128",
|
||||
"httpsProxy": "http://127.0.0.1:3128"
|
||||
}
|
||||
}
|
||||
}
|
||||
67
__tests__/fixtures/inspect10.txt
Normal file
67
__tests__/fixtures/inspect10.txt
Normal file
@@ -0,0 +1,67 @@
|
||||
Name: remote-builder
|
||||
Driver: remote
|
||||
Last Activity: 2023-04-20 12:47:49 +0000 UTC
|
||||
|
||||
Nodes:
|
||||
Name: remote-builder0
|
||||
Endpoint: docker-container://buildx_buildkit_dk-remote-builder0
|
||||
Status: inactive
|
||||
Platforms:
|
||||
|
||||
Name: aws_graviton2
|
||||
Endpoint: tcp://10.0.0.1:1234
|
||||
Driver Options: cacert="/home/user/.certs/aws_graviton2/ca.pem" cert="/home/user/.certs/aws_graviton2/cert.pem" key="/home/user/.certs/aws_graviton2/key.pem"
|
||||
Status: running
|
||||
Buildkit: v0.11.6
|
||||
Platforms: darwin/arm64*, linux/arm64*, linux/arm/v5*, linux/arm/v6*, linux/arm/v7*, windows/arm64*
|
||||
Labels:
|
||||
org.mobyproject.buildkit.worker.executor: oci
|
||||
org.mobyproject.buildkit.worker.hostname: 77ebc22e2d82
|
||||
org.mobyproject.buildkit.worker.network: host
|
||||
org.mobyproject.buildkit.worker.oci.process-mode: sandbox
|
||||
org.mobyproject.buildkit.worker.selinux.enabled: false
|
||||
org.mobyproject.buildkit.worker.snapshotter: overlayfs
|
||||
GC Policy rule#0:
|
||||
All: false
|
||||
Filters: type==source.local,type==exec.cachemount,type==source.git.checkout
|
||||
Keep Duration: 48h0m0s
|
||||
Keep Bytes: 488.3MiB
|
||||
GC Policy rule#1:
|
||||
All: false
|
||||
Keep Duration: 1440h0m0s
|
||||
Keep Bytes: 23.28GiB
|
||||
GC Policy rule#2:
|
||||
All: false
|
||||
Keep Bytes: 23.28GiB
|
||||
GC Policy rule#3:
|
||||
All: true
|
||||
Keep Bytes: 23.28GiB
|
||||
|
||||
Name: linuxone_s390x
|
||||
Endpoint: tcp://10.0.0.2:1234
|
||||
Driver Options: cacert="/home/user/.certs/linuxone_s390x/ca.pem" cert="/home/user/.certs/linuxone_s390x/cert.pem" key="/home/user/.certs/linuxone_s390x/key.pem"
|
||||
Status: running
|
||||
Buildkit: v0.11.6
|
||||
Platforms: linux/s390x*
|
||||
Labels:
|
||||
org.mobyproject.buildkit.worker.executor: oci
|
||||
org.mobyproject.buildkit.worker.hostname: 9d0d62a96818
|
||||
org.mobyproject.buildkit.worker.network: host
|
||||
org.mobyproject.buildkit.worker.oci.process-mode: sandbox
|
||||
org.mobyproject.buildkit.worker.selinux.enabled: false
|
||||
org.mobyproject.buildkit.worker.snapshotter: overlayfs
|
||||
GC Policy rule#0:
|
||||
All: false
|
||||
Filters: type==source.local,type==exec.cachemount,type==source.git.checkout
|
||||
Keep Duration: 48h0m0s
|
||||
Keep Bytes: 488.3MiB
|
||||
GC Policy rule#1:
|
||||
All: false
|
||||
Keep Duration: 1440h0m0s
|
||||
Keep Bytes: 9.313GiB
|
||||
GC Policy rule#2:
|
||||
All: false
|
||||
Keep Bytes: 9.313GiB
|
||||
GC Policy rule#3:
|
||||
All: true
|
||||
Keep Bytes: 9.313GiB
|
||||
34
__tests__/fixtures/inspect8.txt
Normal file
34
__tests__/fixtures/inspect8.txt
Normal file
@@ -0,0 +1,34 @@
|
||||
Name: builder-52aa0611-faf0-42ac-a940-461e4e287d68
|
||||
Driver: docker-container
|
||||
Last Activity: 2023-06-13 13:52:31 +0000 UTC
|
||||
|
||||
Nodes:
|
||||
Name: builder-52aa0611-faf0-42ac-a940-461e4e287d680
|
||||
Endpoint: unix:///var/run/docker.sock
|
||||
Driver Options: image="moby/buildkit:buildx-stable-1" network="host"
|
||||
Status: running
|
||||
Flags: --debug --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
|
||||
Buildkit: v0.11.6
|
||||
Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
|
||||
Labels:
|
||||
org.mobyproject.buildkit.worker.executor: oci
|
||||
org.mobyproject.buildkit.worker.hostname: fv-az572-38
|
||||
org.mobyproject.buildkit.worker.network: host
|
||||
org.mobyproject.buildkit.worker.oci.process-mode: sandbox
|
||||
org.mobyproject.buildkit.worker.selinux.enabled: false
|
||||
org.mobyproject.buildkit.worker.snapshotter: overlayfs
|
||||
GC Policy rule#0:
|
||||
All: false
|
||||
Filters: type==source.local,type==exec.cachemount,type==source.git.checkout
|
||||
Keep Duration: 48h0m0s
|
||||
Keep Bytes: 488.3MiB
|
||||
GC Policy rule#1:
|
||||
All: false
|
||||
Keep Duration: 1440h0m0s
|
||||
Keep Bytes: 8.382GiB
|
||||
GC Policy rule#2:
|
||||
All: false
|
||||
Keep Bytes: 8.382GiB
|
||||
GC Policy rule#3:
|
||||
All: true
|
||||
Keep Bytes: 8.382GiB
|
||||
14
__tests__/fixtures/inspect9.txt
Normal file
14
__tests__/fixtures/inspect9.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
Name: default
|
||||
Driver: docker
|
||||
Last Activity: 2023-06-13 18:13:43 +0000 UTC
|
||||
|
||||
Nodes:
|
||||
Name: default
|
||||
Endpoint: default
|
||||
Status: running
|
||||
Buildkit: v0.11.7-0.20230525183624-798ad6b0ce9f
|
||||
Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
|
||||
GC Policy rule#0:
|
||||
All: true
|
||||
Filters:
|
||||
Keep Bytes: 100GiB
|
||||
@@ -66,9 +66,12 @@ describe('isInsideWorkTree', () => {
|
||||
});
|
||||
|
||||
describe('remoteSha', () => {
|
||||
it('returns git remote sha', async () => {
|
||||
it('returns sha using git ls-remote', async () => {
|
||||
expect(await Git.remoteSha('https://github.com/docker/buildx.git', 'refs/pull/648/head')).toEqual('f11797113e5a9b86bd976329c5dbb8a8bfdfadfa');
|
||||
});
|
||||
it('returns sha using github api', async () => {
|
||||
expect(await Git.remoteSha('https://github.com/docker/buildx.git', 'refs/pull/648/head', process.env.GITHUB_TOKEN)).toEqual('f11797113e5a9b86bd976329c5dbb8a8bfdfadfa');
|
||||
});
|
||||
});
|
||||
|
||||
describe('remoteURL', () => {
|
||||
|
||||
@@ -108,7 +108,7 @@ describe('actionsRuntimeToken', () => {
|
||||
process.env.ACTIONS_RUNTIME_TOKEN = 'foo';
|
||||
expect(() => {
|
||||
GitHub.actionsRuntimeToken;
|
||||
}).toThrowError();
|
||||
}).toThrow();
|
||||
});
|
||||
it('fixture', async () => {
|
||||
process.env.ACTIONS_RUNTIME_TOKEN = fs.readFileSync(path.join(__dirname, 'fixtures', 'runtimeToken.txt')).toString().trim();
|
||||
@@ -131,11 +131,11 @@ describe('printActionsRuntimeTokenACs', () => {
|
||||
});
|
||||
it('empty', async () => {
|
||||
process.env.ACTIONS_RUNTIME_TOKEN = '';
|
||||
await expect(GitHub.printActionsRuntimeTokenACs()).rejects.toThrowError(new Error('ACTIONS_RUNTIME_TOKEN not set'));
|
||||
await expect(GitHub.printActionsRuntimeTokenACs()).rejects.toThrow(new Error('ACTIONS_RUNTIME_TOKEN not set'));
|
||||
});
|
||||
it('malformed', async () => {
|
||||
process.env.ACTIONS_RUNTIME_TOKEN = 'foo';
|
||||
await expect(GitHub.printActionsRuntimeTokenACs()).rejects.toThrowError(new Error("Cannot parse GitHub Actions Runtime Token: Invalid token specified: Cannot read properties of undefined (reading 'replace')"));
|
||||
await expect(GitHub.printActionsRuntimeTokenACs()).rejects.toThrow(new Error("Cannot parse GitHub Actions Runtime Token: Invalid token specified: Cannot read properties of undefined (reading 'replace')"));
|
||||
});
|
||||
it('refs/heads/master', async () => {
|
||||
const infoSpy = jest.spyOn(core, 'info');
|
||||
|
||||
@@ -73,6 +73,18 @@ describe('getInputList', () => {
|
||||
expect(res).toEqual(['user/app:cache', 'type=local,src=path/to/dir']);
|
||||
});
|
||||
|
||||
it('multiline and ignoring comment correctly', async () => {
|
||||
setInput('labels', 'foo=bar\nbar=qux#baz');
|
||||
const res = Util.getInputList('labels');
|
||||
expect(res).toEqual(['foo=bar', 'bar=qux#baz']);
|
||||
});
|
||||
|
||||
it('multiline with comment', async () => {
|
||||
setInput('labels', 'foo=bar\nbar=qux#baz');
|
||||
const res = Util.getInputList('labels', {comment: '#'});
|
||||
expect(res).toEqual(['foo=bar', 'bar=qux']);
|
||||
});
|
||||
|
||||
it('different new lines and ignoring comma correctly', async () => {
|
||||
setInput('cache-from', 'user/app:cache\r\ntype=local,src=path/to/dir');
|
||||
const res = Util.getInputList('cache-from', {ignoreComma: true});
|
||||
@@ -194,13 +206,64 @@ describe('asyncForEach', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('isValidUrl', () => {
|
||||
describe('isValidURL', () => {
|
||||
test.each([
|
||||
['https://github.com/docker/buildx.git', true],
|
||||
['https://github.com/docker/buildx.git#refs/pull/648/head', true],
|
||||
['git@github.com:moby/buildkit.git', false],
|
||||
['git://github.com/user/repo.git', false],
|
||||
['github.com/moby/buildkit.git#main', false],
|
||||
['v0.4.1', false]
|
||||
])('given %p', async (url, expected) => {
|
||||
expect(Util.isValidUrl(url)).toEqual(expected);
|
||||
expect(Util.isValidURL(url)).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describe('isValidRef', () => {
|
||||
test.each([
|
||||
['https://github.com/docker/buildx.git', true],
|
||||
['https://github.com/docker/buildx.git#refs/pull/648/head', true],
|
||||
['git@github.com:moby/buildkit.git', true],
|
||||
['git://github.com/user/repo.git', true],
|
||||
['github.com/moby/buildkit.git#main', true],
|
||||
['v0.4.1', false]
|
||||
])('given %p', async (url, expected) => {
|
||||
expect(Util.isValidRef(url)).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describe('trimPrefix', () => {
|
||||
test.each([
|
||||
['', 'abc', ''],
|
||||
['abc', 'a', 'bc'],
|
||||
['abc', 'ab', 'c'],
|
||||
['abc', '', 'abc'],
|
||||
['abc', '', 'abc'],
|
||||
['abc', 'd', 'abc'],
|
||||
['abc', 'abc', ''],
|
||||
['abc', 'abcd', 'abc'],
|
||||
['abcdabc', 'abc', 'dabc'],
|
||||
['abcabc', 'abc', 'abc'],
|
||||
['abcdabc', 'd', 'abcdabc']
|
||||
])('given %p', async (str, prefix, expected) => {
|
||||
expect(Util.trimPrefix(str, prefix)).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describe('trimSuffix', () => {
|
||||
test.each([
|
||||
['', 'abc', ''],
|
||||
['abc', 'c', 'ab'],
|
||||
['abc', '', 'abc'],
|
||||
['abc', 'bc', 'a'],
|
||||
['abc', 'abc', ''],
|
||||
['abc', 'abcd', 'abc'],
|
||||
['abc', 'aabc', 'abc'],
|
||||
['abcdabc', 'abc', 'abcd'],
|
||||
['abcabc', 'abc', 'abc'],
|
||||
['abcdabc', 'd', 'abcdabc']
|
||||
])('given %p', async (str, suffix, expected) => {
|
||||
expect(Util.trimSuffix(str, suffix)).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=bind,from=buildx,source=/buildx,target=/usr/libexec/docker/cli-plugins/docker-buildx \
|
||||
--mount=type=bind,from=buildx,source=/buildx,target=/usr/bin/buildx \
|
||||
--mount=type=secret,id=GITHUB_TOKEN \
|
||||
GITHUB_TOKEN=$(cat /run/secrets/GITHUB_TOKEN) yarn run test-coverage --coverageDirectory=/tmp/coverage
|
||||
GITHUB_TOKEN=$(cat /run/secrets/GITHUB_TOKEN) yarn run test:coverage --coverageDirectory=/tmp/coverage
|
||||
|
||||
FROM scratch AS test-coverage
|
||||
COPY --from=test /tmp/coverage /
|
||||
|
||||
@@ -19,7 +19,7 @@ module.exports = {
|
||||
testEnvironment: 'node',
|
||||
moduleFileExtensions: ['js', 'ts'],
|
||||
setupFiles: ['dotenv/config'],
|
||||
testMatch: ['**/*.test.e2e.ts'],
|
||||
testMatch: ['**/*.test.itg.ts'],
|
||||
testTimeout: 1800000, // 30 minutes
|
||||
transform: {
|
||||
'^.+\\.ts$': 'ts-jest'
|
||||
43
package.json
43
package.json
@@ -11,9 +11,10 @@
|
||||
"prettier": "prettier --check \"./**/*.ts\"",
|
||||
"prettier:fix": "prettier --write \"./**/*.ts\"",
|
||||
"test": "jest",
|
||||
"test:e2e": "jest -c jest.config.e2e.ts --runInBand --detectOpenHandles",
|
||||
"test-coverage": "jest --coverage",
|
||||
"test-coverage:e2e": "jest --coverage -c jest.config.e2e.ts --runInBand --detectOpenHandles"
|
||||
"test:coverage": "jest --coverage",
|
||||
"test:itg": "jest -c jest.config.itg.ts --runInBand --detectOpenHandles",
|
||||
"test:itg-list": "jest -c jest.config.itg.ts --listTests",
|
||||
"test:itg-coverage": "jest --coverage -c jest.config.itg.ts --runInBand --detectOpenHandles"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -44,38 +45,40 @@
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/cache": "^3.2.2",
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/github": "^5.1.1",
|
||||
"@actions/http-client": "^2.0.1",
|
||||
"@actions/io": "^1.1.2",
|
||||
"@actions/http-client": "^2.1.1",
|
||||
"@actions/io": "^1.1.3",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^7.2.3",
|
||||
"async-retry": "^1.3.3",
|
||||
"csv-parse": "^5.3.6",
|
||||
"handlebars": "^4.7.7",
|
||||
"csv-parse": "^5.4.0",
|
||||
"handlebars": "^4.7.8",
|
||||
"jwt-decode": "^3.1.2",
|
||||
"semver": "^7.3.8",
|
||||
"semver": "^7.5.4",
|
||||
"tmp": "^0.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/csv-parse": "^1.2.2",
|
||||
"@types/node": "^16.18.11",
|
||||
"@types/semver": "^7.3.13",
|
||||
"@types/node": "^16.18.21",
|
||||
"@types/semver": "^7.5.0",
|
||||
"@types/tmp": "^0.2.3",
|
||||
"@typescript-eslint/eslint-plugin": "^5.49.0",
|
||||
"@typescript-eslint/parser": "^5.49.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.56.0",
|
||||
"@typescript-eslint/parser": "^5.56.0",
|
||||
"cpy-cli": "^4.2.0",
|
||||
"dotenv": "^16.0.3",
|
||||
"eslint": "^8.33.0",
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"eslint": "^8.36.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-jest": "^26.9.0",
|
||||
"eslint-plugin-jest": "^27.2.1",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"jest": "^27.5.1",
|
||||
"prettier": "^2.8.3",
|
||||
"rimraf": "^4.1.2",
|
||||
"ts-jest": "^27.1.5",
|
||||
"jest": "^29.5.0",
|
||||
"prettier": "^2.8.7",
|
||||
"rimraf": "^4.4.1",
|
||||
"ts-jest": "^29.0.5",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.9.4"
|
||||
"typescript": "^4.9.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
import {Buildx} from './buildx';
|
||||
import {Exec} from '../exec';
|
||||
import {Inputs} from './inputs';
|
||||
import {Util} from '../util';
|
||||
|
||||
import {BakeDefinition} from '../types/bake';
|
||||
|
||||
@@ -31,16 +32,47 @@ export class Bake {
|
||||
this.buildx = opts?.buildx || new Buildx();
|
||||
}
|
||||
|
||||
public async parseDefinitions(files: Array<string>, targets: Array<string>): Promise<BakeDefinition> {
|
||||
public async parseDefinitions(sources: Array<string>, targets?: Array<string>, overrides?: Array<string>, load?: boolean, push?: boolean, workdir?: string): Promise<BakeDefinition> {
|
||||
const args = ['bake'];
|
||||
if (files) {
|
||||
for (const file of files) {
|
||||
args.push('--file', file);
|
||||
|
||||
let remoteDef;
|
||||
const files: Array<string> = [];
|
||||
if (sources) {
|
||||
for (const source of sources.map(v => v.trim())) {
|
||||
if (source.length == 0) {
|
||||
continue;
|
||||
}
|
||||
if (!Util.isValidRef(source)) {
|
||||
files.push(source);
|
||||
continue;
|
||||
}
|
||||
if (remoteDef) {
|
||||
throw new Error(`Only one remote bake definition is allowed`);
|
||||
}
|
||||
remoteDef = source;
|
||||
}
|
||||
}
|
||||
if (remoteDef) {
|
||||
args.push(remoteDef);
|
||||
}
|
||||
for (const file of files) {
|
||||
args.push('--file', file);
|
||||
}
|
||||
if (overrides) {
|
||||
for (const override of overrides) {
|
||||
args.push('--set', override);
|
||||
}
|
||||
}
|
||||
if (load) {
|
||||
args.push('--load');
|
||||
}
|
||||
if (push) {
|
||||
args.push('--push');
|
||||
}
|
||||
|
||||
const printCmd = await this.buildx.getCommand([...args, '--print', ...targets]);
|
||||
const printCmd = await this.buildx.getCommand([...args, '--print', ...(targets || [])]);
|
||||
return await Exec.getExecOutput(printCmd.command, printCmd.args, {
|
||||
cwd: workdir,
|
||||
ignoreReturnCode: true,
|
||||
silent: true
|
||||
}).then(res => {
|
||||
@@ -67,7 +99,9 @@ export class Bake {
|
||||
const exporters = new Array<string>();
|
||||
for (const key in def.target) {
|
||||
const target = def.target[key];
|
||||
exporters.push(...target.output);
|
||||
if (target.output) {
|
||||
exporters.push(...target.output);
|
||||
}
|
||||
}
|
||||
return exporters;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import * as core from '@actions/core';
|
||||
import {Buildx} from './buildx';
|
||||
import {Exec} from '../exec';
|
||||
|
||||
import {BuilderInfo, NodeInfo} from '../types/builder';
|
||||
import {BuilderInfo, GCPolicy, NodeInfo} from '../types/builder';
|
||||
|
||||
export interface BuilderOpts {
|
||||
buildx?: Buildx;
|
||||
@@ -72,55 +72,73 @@ export class Builder {
|
||||
const builder: BuilderInfo = {
|
||||
nodes: []
|
||||
};
|
||||
let node: NodeInfo = {};
|
||||
let parsingType: string | undefined;
|
||||
let currentNode: NodeInfo = {};
|
||||
let currentGCPolicy: GCPolicy | undefined;
|
||||
for (const line of data.trim().split(`\n`)) {
|
||||
const [key, ...rest] = line.split(':');
|
||||
const lkey = key.toLowerCase();
|
||||
const value = rest.map(v => v.trim()).join(':');
|
||||
if (key.length == 0 || value.length == 0) {
|
||||
if (key.length == 0) {
|
||||
continue;
|
||||
}
|
||||
switch (key.toLowerCase()) {
|
||||
case 'name': {
|
||||
switch (true) {
|
||||
case lkey == 'name': {
|
||||
parsingType = undefined;
|
||||
if (builder.name == undefined) {
|
||||
builder.name = value;
|
||||
} else {
|
||||
if (Object.keys(node).length > 0) {
|
||||
builder.nodes.push(node);
|
||||
node = {};
|
||||
if (currentGCPolicy && currentNode.gcPolicy) {
|
||||
currentNode.gcPolicy.push(currentGCPolicy);
|
||||
currentGCPolicy = undefined;
|
||||
}
|
||||
node.name = value;
|
||||
if (currentNode.name) {
|
||||
builder.nodes.push(currentNode);
|
||||
}
|
||||
currentNode = {name: value};
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'driver': {
|
||||
case lkey == 'driver': {
|
||||
parsingType = undefined;
|
||||
builder.driver = value;
|
||||
break;
|
||||
}
|
||||
case 'last activity': {
|
||||
case lkey == 'last activity': {
|
||||
parsingType = undefined;
|
||||
builder.lastActivity = new Date(value);
|
||||
break;
|
||||
}
|
||||
case 'endpoint': {
|
||||
node.endpoint = value;
|
||||
case lkey == 'endpoint': {
|
||||
parsingType = undefined;
|
||||
currentNode.endpoint = value;
|
||||
break;
|
||||
}
|
||||
case 'driver options': {
|
||||
node['driver-opts'] = (value.match(/([a-zA-Z0-9_.]+)="([^"]*)"/g) || []).map(v => v.replace(/^(.*)="(.*)"$/g, '$1=$2'));
|
||||
case lkey == 'driver options': {
|
||||
parsingType = undefined;
|
||||
currentNode['driver-opts'] = (value.match(/([a-zA-Z0-9_.]+)="([^"]*)"/g) || []).map(v => v.replace(/^(.*)="(.*)"$/g, '$1=$2'));
|
||||
break;
|
||||
}
|
||||
case 'status': {
|
||||
node.status = value;
|
||||
case lkey == 'status': {
|
||||
parsingType = undefined;
|
||||
currentNode.status = value;
|
||||
break;
|
||||
}
|
||||
case 'flags': {
|
||||
node['buildkitd-flags'] = value;
|
||||
case lkey == 'flags': {
|
||||
parsingType = undefined;
|
||||
currentNode['buildkitd-flags'] = value;
|
||||
break;
|
||||
}
|
||||
case 'buildkit': {
|
||||
node.buildkit = value;
|
||||
case lkey == 'buildkit': {
|
||||
parsingType = undefined;
|
||||
currentNode.buildkit = value;
|
||||
break;
|
||||
}
|
||||
case 'platforms': {
|
||||
case lkey == 'platforms': {
|
||||
parsingType = undefined;
|
||||
if (!value) {
|
||||
break;
|
||||
}
|
||||
let platforms: Array<string> = [];
|
||||
// if a preferred platform is being set then use only these
|
||||
// https://docs.docker.com/engine/reference/commandline/buildx_inspect/#get-information-about-a-builder-instance
|
||||
@@ -134,13 +152,63 @@ export class Builder {
|
||||
// otherwise set all platforms available
|
||||
platforms = value.split(', ');
|
||||
}
|
||||
node.platforms = platforms.join(',');
|
||||
currentNode.platforms = platforms.join(',');
|
||||
break;
|
||||
}
|
||||
case lkey == 'labels': {
|
||||
parsingType = 'label';
|
||||
currentNode.labels = {};
|
||||
break;
|
||||
}
|
||||
case lkey.startsWith('gc policy rule#'): {
|
||||
parsingType = 'gcpolicy';
|
||||
if (currentNode.gcPolicy && currentGCPolicy) {
|
||||
currentNode.gcPolicy.push(currentGCPolicy);
|
||||
currentGCPolicy = undefined;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
switch (parsingType || '') {
|
||||
case 'label': {
|
||||
currentNode.labels = currentNode.labels || {};
|
||||
currentNode.labels[key.trim()] = value;
|
||||
break;
|
||||
}
|
||||
case 'gcpolicy': {
|
||||
currentNode.gcPolicy = currentNode.gcPolicy || [];
|
||||
currentGCPolicy = currentGCPolicy || {};
|
||||
switch (lkey.trim()) {
|
||||
case 'all': {
|
||||
currentGCPolicy.all = value == 'true';
|
||||
break;
|
||||
}
|
||||
case 'filters': {
|
||||
if (value) {
|
||||
currentGCPolicy.filter = value.split(',');
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'keep duration': {
|
||||
currentGCPolicy.keepDuration = value;
|
||||
break;
|
||||
}
|
||||
case 'keep bytes': {
|
||||
currentGCPolicy.keepBytes = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Object.keys(node).length > 0) {
|
||||
builder.nodes.push(node);
|
||||
if (currentGCPolicy && currentNode.gcPolicy) {
|
||||
currentNode.gcPolicy.push(currentGCPolicy);
|
||||
}
|
||||
if (currentNode.name) {
|
||||
builder.nodes.push(currentNode);
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,18 @@ import {parse} from 'csv-parse/sync';
|
||||
|
||||
import {Context} from '../context';
|
||||
|
||||
const parseKvp = (kvp: string): [string, string] => {
|
||||
const delimiterIndex = kvp.indexOf('=');
|
||||
const key = kvp.substring(0, delimiterIndex);
|
||||
const value = kvp.substring(delimiterIndex + 1);
|
||||
|
||||
if (key.length == 0 || value.length == 0) {
|
||||
throw new Error(`${kvp} is not a valid secret`);
|
||||
}
|
||||
|
||||
return [key, value];
|
||||
};
|
||||
|
||||
export class Inputs {
|
||||
public static getBuildImageIDFilePath(): string {
|
||||
return path.join(Context.tmpDir(), 'iidfile');
|
||||
@@ -70,13 +82,17 @@ export class Inputs {
|
||||
return Inputs.resolveBuildSecret(kvp, true);
|
||||
}
|
||||
|
||||
public static resolveBuildSecretEnv(kvp: string): string {
|
||||
const [key, value] = parseKvp(kvp);
|
||||
|
||||
return `id=${key},env="${value}"`;
|
||||
}
|
||||
|
||||
public static resolveBuildSecret(kvp: string, file: boolean): string {
|
||||
const delimiterIndex = kvp.indexOf('=');
|
||||
const key = kvp.substring(0, delimiterIndex);
|
||||
let value = kvp.substring(delimiterIndex + 1);
|
||||
if (key.length == 0 || value.length == 0) {
|
||||
throw new Error(`${kvp} is not a valid secret`);
|
||||
}
|
||||
const [key, _value] = parseKvp(kvp);
|
||||
|
||||
let value = _value;
|
||||
|
||||
if (file) {
|
||||
if (!fs.existsSync(value)) {
|
||||
throw new Error(`secret file ${value} not found`);
|
||||
|
||||
@@ -14,12 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import crypto from 'crypto';
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import * as core from '@actions/core';
|
||||
import * as httpm from '@actions/http-client';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import * as cache from '@actions/cache';
|
||||
import * as semver from 'semver';
|
||||
import * as util from 'util';
|
||||
|
||||
@@ -28,6 +30,7 @@ import {Context} from '../context';
|
||||
import {Exec} from '../exec';
|
||||
import {Docker} from '../docker/docker';
|
||||
import {Git} from '../git';
|
||||
import {Util} from '../util';
|
||||
|
||||
import {GitHubRelease} from '../types/github';
|
||||
|
||||
@@ -42,70 +45,87 @@ export class Install {
|
||||
this._standalone = opts?.standalone;
|
||||
}
|
||||
|
||||
/*
|
||||
* Download buildx binary from GitHub release
|
||||
* @param version semver version or latest
|
||||
* @returns path to the buildx binary
|
||||
*/
|
||||
public async download(version: string): Promise<string> {
|
||||
const release: GitHubRelease = await Install.getRelease(version);
|
||||
const fversion = release.tag_name.replace(/^v+|v+$/g, '');
|
||||
core.debug(`Install.download version: ${fversion}`);
|
||||
core.debug(`Install.download release tag name: ${release.tag_name}`);
|
||||
|
||||
let toolPath: string;
|
||||
toolPath = tc.find('buildx', fversion, this.platform());
|
||||
if (!toolPath) {
|
||||
const c = semver.clean(fversion) || '';
|
||||
if (!semver.valid(c)) {
|
||||
throw new Error(`Invalid Buildx version "${fversion}".`);
|
||||
}
|
||||
toolPath = await this.fetchBinary(fversion);
|
||||
const vspec = await this.vspec(release.tag_name);
|
||||
core.debug(`Install.download vspec: ${vspec}`);
|
||||
|
||||
const c = semver.clean(vspec) || '';
|
||||
if (!semver.valid(c)) {
|
||||
throw new Error(`Invalid Buildx version "${vspec}".`);
|
||||
}
|
||||
core.debug(`Install.download toolPath: ${toolPath}`);
|
||||
|
||||
return toolPath;
|
||||
const installCache = new InstallCache('buildx-dl-bin', vspec);
|
||||
|
||||
const cacheFoundPath = await installCache.find();
|
||||
if (cacheFoundPath) {
|
||||
core.info(`Buildx binary found in ${cacheFoundPath}`);
|
||||
return cacheFoundPath;
|
||||
}
|
||||
|
||||
const downloadURL = util.format('https://github.com/docker/buildx/releases/download/v%s/%s', vspec, this.filename(vspec));
|
||||
core.info(`Downloading ${downloadURL}`);
|
||||
|
||||
const htcDownloadPath = await tc.downloadTool(downloadURL);
|
||||
core.debug(`Install.download htcDownloadPath: ${htcDownloadPath}`);
|
||||
|
||||
const cacheSavePath = await installCache.save(htcDownloadPath);
|
||||
core.info(`Cached to ${cacheSavePath}`);
|
||||
return cacheSavePath;
|
||||
}
|
||||
|
||||
/*
|
||||
* Build buildx binary from source
|
||||
* @param gitContext git repo context
|
||||
* @returns path to the buildx binary
|
||||
*/
|
||||
public async build(gitContext: string): Promise<string> {
|
||||
// eslint-disable-next-line prefer-const
|
||||
let [repo, ref] = gitContext.split('#');
|
||||
if (ref.length == 0) {
|
||||
ref = 'master';
|
||||
const vspec = await this.vspec(gitContext);
|
||||
core.debug(`Install.build vspec: ${vspec}`);
|
||||
|
||||
const installCache = new InstallCache('buildx-build-bin', vspec);
|
||||
|
||||
const cacheFoundPath = await installCache.find();
|
||||
if (cacheFoundPath) {
|
||||
core.info(`Buildx binary found in ${cacheFoundPath}`);
|
||||
return cacheFoundPath;
|
||||
}
|
||||
|
||||
let vspec: string;
|
||||
// TODO: include full ref as fingerprint. Use commit sha as best-effort in the meantime.
|
||||
if (ref.match(/^[0-9a-fA-F]{40}$/)) {
|
||||
vspec = ref;
|
||||
} else {
|
||||
vspec = await Git.remoteSha(repo, ref);
|
||||
}
|
||||
core.debug(`Install.build: tool version spec ${vspec}`);
|
||||
const outputDir = path.join(Context.tmpDir(), 'buildx-build-cache');
|
||||
const buildCmd = await this.buildCommand(gitContext, outputDir);
|
||||
|
||||
let toolPath: string;
|
||||
toolPath = tc.find('buildx', vspec);
|
||||
if (!toolPath) {
|
||||
const outputDir = path.join(Context.tmpDir(), 'build-cache');
|
||||
const buildCmd = await this.buildCommand(gitContext, outputDir);
|
||||
toolPath = await Exec.getExecOutput(buildCmd.command, buildCmd.args, {
|
||||
ignoreReturnCode: true
|
||||
}).then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
core.warning(res.stderr.trim());
|
||||
}
|
||||
return tc.cacheFile(`${outputDir}/buildx`, os.platform() == 'win32' ? 'docker-buildx.exe' : 'docker-buildx', 'buildx', vspec);
|
||||
});
|
||||
}
|
||||
const buildBinPath = await Exec.getExecOutput(buildCmd.command, buildCmd.args, {
|
||||
ignoreReturnCode: true
|
||||
}).then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
throw new Error(`build failed with: ${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`);
|
||||
}
|
||||
return `${outputDir}/buildx`;
|
||||
});
|
||||
|
||||
return toolPath;
|
||||
const cacheSavePath = await installCache.save(buildBinPath);
|
||||
core.info(`Cached to ${cacheSavePath}`);
|
||||
return cacheSavePath;
|
||||
}
|
||||
|
||||
public async installStandalone(toolPath: string, dest?: string): Promise<string> {
|
||||
public async installStandalone(binPath: string, dest?: string): Promise<string> {
|
||||
core.info('Standalone mode');
|
||||
dest = dest || Context.tmpDir();
|
||||
const toolBinPath = path.join(toolPath, os.platform() == 'win32' ? 'docker-buildx.exe' : 'docker-buildx');
|
||||
const binDir = path.join(dest, 'bin');
|
||||
|
||||
const binDir = path.join(dest, 'buildx-bin-standalone');
|
||||
if (!fs.existsSync(binDir)) {
|
||||
fs.mkdirSync(binDir, {recursive: true});
|
||||
}
|
||||
const filename: string = os.platform() == 'win32' ? 'buildx.exe' : 'buildx';
|
||||
const buildxPath: string = path.join(binDir, filename);
|
||||
fs.copyFileSync(toolBinPath, buildxPath);
|
||||
const binName: string = os.platform() == 'win32' ? 'buildx.exe' : 'buildx';
|
||||
const buildxPath: string = path.join(binDir, binName);
|
||||
fs.copyFileSync(binPath, buildxPath);
|
||||
|
||||
core.info('Fixing perms');
|
||||
fs.chmodSync(buildxPath, '0755');
|
||||
@@ -117,17 +137,17 @@ export class Install {
|
||||
return buildxPath;
|
||||
}
|
||||
|
||||
public async installPlugin(toolPath: string, dest?: string): Promise<string> {
|
||||
public async installPlugin(binPath: string, dest?: string): Promise<string> {
|
||||
core.info('Docker plugin mode');
|
||||
dest = dest || Docker.configDir;
|
||||
const toolBinPath = path.join(toolPath, os.platform() == 'win32' ? 'docker-buildx.exe' : 'docker-buildx');
|
||||
|
||||
const pluginsDir: string = path.join(dest, 'cli-plugins');
|
||||
if (!fs.existsSync(pluginsDir)) {
|
||||
fs.mkdirSync(pluginsDir, {recursive: true});
|
||||
}
|
||||
const filename: string = os.platform() == 'win32' ? 'docker-buildx.exe' : 'docker-buildx';
|
||||
const pluginPath: string = path.join(pluginsDir, filename);
|
||||
fs.copyFileSync(toolBinPath, pluginPath);
|
||||
const binName: string = os.platform() == 'win32' ? 'docker-buildx.exe' : 'docker-buildx';
|
||||
const pluginPath: string = path.join(pluginsDir, binName);
|
||||
fs.copyFileSync(binPath, pluginPath);
|
||||
|
||||
core.info('Fixing perms');
|
||||
fs.chmodSync(pluginPath, '0755');
|
||||
@@ -157,14 +177,14 @@ export class Install {
|
||||
throw new Error(`Neither buildx standalone or plugin have been found to build from ref ${gitContext}`);
|
||||
}
|
||||
|
||||
const args = ['build', '--target', 'binaries', '--platform', 'local', '--build-arg', 'BUILDKIT_CONTEXT_KEEP_GIT_DIR=1', '--output', `type=local,dest=${outputDir}`];
|
||||
if (process.env.GIT_AUTH_TOKEN) {
|
||||
args.push('--secret', 'id=GIT_AUTH_TOKEN');
|
||||
}
|
||||
args.push(gitContext);
|
||||
|
||||
//prettier-ignore
|
||||
return await new Buildx({standalone: buildStandalone}).getCommand([
|
||||
'build',
|
||||
'--target', 'binaries',
|
||||
'--build-arg', 'BUILDKIT_CONTEXT_KEEP_GIT_DIR=1',
|
||||
'--output', `type=local,dest=${outputDir}`,
|
||||
gitContext
|
||||
]);
|
||||
return await new Buildx({standalone: buildStandalone}).getCommand(args);
|
||||
}
|
||||
|
||||
private async isStandalone(): Promise<boolean> {
|
||||
@@ -173,21 +193,6 @@ export class Install {
|
||||
return standalone;
|
||||
}
|
||||
|
||||
private async fetchBinary(version: string): Promise<string> {
|
||||
const targetFile: string = os.platform() == 'win32' ? 'docker-buildx.exe' : 'docker-buildx';
|
||||
const downloadURL = util.format('https://github.com/docker/buildx/releases/download/v%s/%s', version, this.filename(version));
|
||||
core.info(`Downloading ${downloadURL}`);
|
||||
const downloadPath = await tc.downloadTool(downloadURL);
|
||||
core.debug(`Install.fetchBinary downloadPath: ${downloadPath}`);
|
||||
return await tc.cacheFile(downloadPath, targetFile, 'buildx', version);
|
||||
}
|
||||
|
||||
private platform(): string {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const arm_version = (process.config.variables as any).arm_version;
|
||||
return `${os.platform()}-${os.arch()}${arm_version ? 'v' + arm_version : ''}`;
|
||||
}
|
||||
|
||||
private filename(version: string): string {
|
||||
let arch: string;
|
||||
switch (os.arch()) {
|
||||
@@ -215,6 +220,39 @@ export class Install {
|
||||
return util.format('buildx-v%s.%s-%s%s', version, platform, arch, ext);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get version spec (fingerprint) for cache key. If versionOrRef is a valid
|
||||
* Git context, then return the SHA of the ref along the repo and owner and
|
||||
* create a hash of it. Otherwise, return the versionOrRef (semver) as is
|
||||
* without the 'v' prefix.
|
||||
*/
|
||||
private async vspec(versionOrRef: string): Promise<string> {
|
||||
if (!Util.isValidRef(versionOrRef)) {
|
||||
const v = versionOrRef.replace(/^v+|v+$/g, '');
|
||||
core.info(`Use ${v} version spec cache key for ${versionOrRef}`);
|
||||
return v;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line prefer-const
|
||||
let [baseURL, ref] = versionOrRef.split('#');
|
||||
if (ref.length == 0) {
|
||||
ref = 'master';
|
||||
}
|
||||
|
||||
let sha: string;
|
||||
if (ref.match(/^[0-9a-fA-F]{40}$/)) {
|
||||
sha = ref;
|
||||
} else {
|
||||
sha = await Git.remoteSha(baseURL, ref, process.env.GIT_AUTH_TOKEN);
|
||||
}
|
||||
|
||||
const [owner, repo] = baseURL.substring('https://github.com/'.length).split('/');
|
||||
const key = `${owner}/${Util.trimSuffix(repo, '.git')}/${sha}`;
|
||||
const hash = crypto.createHash('sha256').update(key).digest('hex');
|
||||
core.info(`Use ${hash} version spec cache key for ${key}`);
|
||||
return hash;
|
||||
}
|
||||
|
||||
public static async getRelease(version: string): Promise<GitHubRelease> {
|
||||
const url = `https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/buildx-releases.json`;
|
||||
const http: httpm.HttpClient = new httpm.HttpClient('docker-actions-toolkit');
|
||||
@@ -231,3 +269,74 @@ export class Install {
|
||||
return releases[version];
|
||||
}
|
||||
}
|
||||
|
||||
class InstallCache {
|
||||
private readonly htcName: string;
|
||||
private readonly htcVersion: string;
|
||||
private readonly ghaCacheKey: string;
|
||||
private readonly cacheDir: string;
|
||||
private readonly cacheFile: string;
|
||||
private readonly cachePath: string;
|
||||
|
||||
constructor(htcName: string, htcVersion: string) {
|
||||
this.htcName = htcName;
|
||||
this.htcVersion = htcVersion;
|
||||
this.ghaCacheKey = util.format('%s-%s-%s', this.htcName, this.htcVersion, this.platform());
|
||||
this.cacheDir = path.join(Buildx.configDir, '.bin', htcVersion, this.platform());
|
||||
this.cacheFile = os.platform() == 'win32' ? 'docker-buildx.exe' : 'docker-buildx';
|
||||
this.cachePath = path.join(this.cacheDir, this.cacheFile);
|
||||
if (!fs.existsSync(this.cacheDir)) {
|
||||
fs.mkdirSync(this.cacheDir, {recursive: true});
|
||||
}
|
||||
}
|
||||
|
||||
public async save(file: string): Promise<string> {
|
||||
core.debug(`InstallCache.save ${file}`);
|
||||
const cachePath = this.copyToCache(file);
|
||||
|
||||
const htcPath = await tc.cacheDir(this.cacheDir, this.htcName, this.htcVersion, this.platform());
|
||||
core.debug(`InstallCache.save cached to hosted tool cache ${htcPath}`);
|
||||
|
||||
if (cache.isFeatureAvailable()) {
|
||||
core.debug(`InstallCache.save caching ${this.ghaCacheKey} to GitHub Actions cache`);
|
||||
await cache.saveCache([this.cacheDir], this.ghaCacheKey);
|
||||
}
|
||||
|
||||
return cachePath;
|
||||
}
|
||||
|
||||
public async find(): Promise<string> {
|
||||
let htcPath = tc.find(this.htcName, this.htcVersion, this.platform());
|
||||
if (htcPath) {
|
||||
core.info(`Restored from hosted tool cache ${htcPath}`);
|
||||
return this.copyToCache(`${htcPath}/${this.cacheFile}`);
|
||||
}
|
||||
|
||||
if (cache.isFeatureAvailable()) {
|
||||
core.debug(`GitHub Actions cache feature available`);
|
||||
if (await cache.restoreCache([this.cacheDir], this.ghaCacheKey)) {
|
||||
core.info(`Restored ${this.ghaCacheKey} from GitHub Actions cache`);
|
||||
htcPath = await tc.cacheDir(this.cacheDir, this.htcName, this.htcVersion, this.platform());
|
||||
core.info(`Restored to hosted tool cache ${htcPath}`);
|
||||
return this.copyToCache(`${htcPath}/${this.cacheFile}`);
|
||||
}
|
||||
} else {
|
||||
core.info(`GitHub Actions cache feature not available`);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
private copyToCache(file: string): string {
|
||||
core.debug(`Copying ${file} to ${this.cachePath}`);
|
||||
fs.copyFileSync(file, this.cachePath);
|
||||
fs.chmodSync(this.cachePath, '0755');
|
||||
return this.cachePath;
|
||||
}
|
||||
|
||||
private platform(): string {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const arm_version = (process.config.variables as any).arm_version;
|
||||
return `${os.platform()}-${os.arch()}${arm_version ? 'v' + arm_version : ''}`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,17 +14,29 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import * as core from '@actions/core';
|
||||
import * as io from '@actions/io';
|
||||
|
||||
import {Exec} from '../exec';
|
||||
|
||||
import {ConfigFile} from '../types/docker';
|
||||
|
||||
export class Docker {
|
||||
static get configDir(): string {
|
||||
return process.env.DOCKER_CONFIG || path.join(os.homedir(), '.docker');
|
||||
}
|
||||
|
||||
public static configFile(): ConfigFile | undefined {
|
||||
const f = path.join(Docker.configDir, 'config.json');
|
||||
if (!fs.existsSync(f)) {
|
||||
return undefined;
|
||||
}
|
||||
return <ConfigFile>JSON.parse(fs.readFileSync(f, {encoding: 'utf-8'}));
|
||||
}
|
||||
|
||||
public static async isAvailable(): Promise<boolean> {
|
||||
return await io
|
||||
.which('docker', true)
|
||||
|
||||
38
src/git.ts
38
src/git.ts
@@ -14,8 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import * as core from '@actions/core';
|
||||
import {Octokit} from '@octokit/core';
|
||||
import {restEndpointMethods} from '@octokit/plugin-rest-endpoint-methods';
|
||||
|
||||
import {Exec} from './exec';
|
||||
import {GitHub} from './github';
|
||||
import {Context} from '@actions/github/lib/context';
|
||||
|
||||
import {Context as GitContext} from './types/git';
|
||||
|
||||
export class Git {
|
||||
@@ -36,7 +42,29 @@ export class Git {
|
||||
});
|
||||
}
|
||||
|
||||
public static async remoteSha(repo: string, ref: string): Promise<string> {
|
||||
public static async remoteSha(repo: string, ref: string, token?: string): Promise<string> {
|
||||
const repoMatch = repo.match(/github.com\/([^/]+)\/([^/]+?)(?:\.git)?(\/|$)/);
|
||||
// if we have a token and this is a GitHub repo we can use the GitHub API
|
||||
if (token && repoMatch) {
|
||||
core.setSecret(token);
|
||||
const octokit = new (Octokit.plugin(restEndpointMethods).defaults({
|
||||
baseUrl: GitHub.apiURL
|
||||
}))({auth: token});
|
||||
const [owner, repoName] = repoMatch.slice(1, 3);
|
||||
try {
|
||||
return (
|
||||
await octokit.rest.repos.listCommits({
|
||||
owner: owner,
|
||||
repo: repoName,
|
||||
sha: ref,
|
||||
per_page: 1
|
||||
})
|
||||
).data[0].sha;
|
||||
} catch (e) {
|
||||
throw new Error(`Cannot find remote ref for ${repo}#${ref}: ${e.message}`);
|
||||
}
|
||||
}
|
||||
// otherwise we fall back to git ls-remote
|
||||
return await Git.exec(['ls-remote', repo, ref]).then(out => {
|
||||
const [rsha] = out.split(/[\s\t]/);
|
||||
if (rsha.length == 0) {
|
||||
@@ -61,7 +89,13 @@ export class Git {
|
||||
}
|
||||
|
||||
public static async ref(): Promise<string> {
|
||||
return await Git.exec(['symbolic-ref', 'HEAD']);
|
||||
return await Git.exec(['symbolic-ref', 'HEAD']).catch(() => {
|
||||
// if it fails (for example in a detached HEAD state), falls back to
|
||||
// using git tag or describe to get the exact matching tag name.
|
||||
return Git.tag().then(tag => {
|
||||
return `refs/tags/${tag}`;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public static async fullCommit(): Promise<string> {
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
*/
|
||||
|
||||
import {Buildx} from './buildx/buildx';
|
||||
import {Install} from './buildx/install';
|
||||
import {Install as BuildxInstall} from './buildx/install';
|
||||
import {Bake} from './buildx/bake';
|
||||
import {Builder} from './buildx/builder';
|
||||
import {BuildKit} from './buildkit/buildkit';
|
||||
import {GitHub} from './github';
|
||||
@@ -31,14 +32,16 @@ export interface ToolkitOpts {
|
||||
export class Toolkit {
|
||||
public github: GitHub;
|
||||
public buildx: Buildx;
|
||||
public buildxInstall: Install;
|
||||
public buildxInstall: BuildxInstall;
|
||||
public bake: Bake;
|
||||
public builder: Builder;
|
||||
public buildkit: BuildKit;
|
||||
|
||||
constructor(opts: ToolkitOpts = {}) {
|
||||
this.github = new GitHub({token: opts.githubToken});
|
||||
this.buildx = new Buildx();
|
||||
this.buildxInstall = new Install();
|
||||
this.buildxInstall = new BuildxInstall();
|
||||
this.bake = new Bake({buildx: this.buildx});
|
||||
this.builder = new Builder({buildx: this.buildx});
|
||||
this.buildkit = new BuildKit({buildx: this.buildx});
|
||||
}
|
||||
|
||||
@@ -24,22 +24,22 @@ export interface Group {
|
||||
}
|
||||
|
||||
export interface Target {
|
||||
args: Record<string, string>;
|
||||
attest: Array<string>;
|
||||
'cache-from': Array<string>;
|
||||
'cache-to': Array<string>;
|
||||
args?: Record<string, string>;
|
||||
attest?: Array<string>;
|
||||
'cache-from'?: Array<string>;
|
||||
'cache-to'?: Array<string>;
|
||||
context: string;
|
||||
contexts: Record<string, string>;
|
||||
contexts?: Record<string, string>;
|
||||
dockerfile: string;
|
||||
'dockerfile-inline': string;
|
||||
labels: Record<string, string>;
|
||||
'no-cache': boolean;
|
||||
'no-cache-filter': Array<string>;
|
||||
output: Array<string>;
|
||||
platforms: Array<string>;
|
||||
pull: boolean;
|
||||
secret: Array<string>;
|
||||
ssh: Array<string>;
|
||||
tags: Array<string>;
|
||||
target: string;
|
||||
'dockerfile-inline'?: string;
|
||||
labels?: Record<string, string>;
|
||||
'no-cache'?: boolean;
|
||||
'no-cache-filter'?: Array<string>;
|
||||
output?: Array<string>;
|
||||
platforms?: Array<string>;
|
||||
pull?: boolean;
|
||||
secret?: Array<string>;
|
||||
ssh?: Array<string>;
|
||||
tags?: Array<string>;
|
||||
target?: string;
|
||||
}
|
||||
|
||||
@@ -32,4 +32,13 @@ export interface Node {
|
||||
export interface NodeInfo extends Node {
|
||||
status?: string;
|
||||
buildkit?: string;
|
||||
labels?: Record<string, string>;
|
||||
gcPolicy?: Array<GCPolicy>;
|
||||
}
|
||||
|
||||
export interface GCPolicy {
|
||||
all?: boolean;
|
||||
filter?: string[];
|
||||
keepDuration?: string;
|
||||
keepBytes?: string;
|
||||
}
|
||||
|
||||
66
src/types/docker.ts
Normal file
66
src/types/docker.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* Copyright 2023 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.
|
||||
*/
|
||||
|
||||
// https://github.com/docker/cli/blob/master/cli/config/configfile/file.go
|
||||
export interface ConfigFile {
|
||||
auths: Record<string, AuthConfig>;
|
||||
HttpHeaders?: Record<string, string>;
|
||||
psFormat?: string;
|
||||
imagesFormat?: string;
|
||||
networksFormat?: string;
|
||||
pluginsFormat?: string;
|
||||
volumesFormat?: string;
|
||||
statsFormat?: string;
|
||||
detachKeys?: string;
|
||||
credsStore?: string;
|
||||
credHelpers?: Record<string, string>;
|
||||
serviceInspectFormat?: string;
|
||||
servicesFormat?: string;
|
||||
tasksFormat?: string;
|
||||
secretFormat?: string;
|
||||
configFormat?: string;
|
||||
nodesFormat?: string;
|
||||
pruneFilters?: string[];
|
||||
proxies?: Record<string, ProxyConfig>;
|
||||
experimental?: string;
|
||||
stackOrchestrator?: string;
|
||||
kubernetes?: KubernetesConfig;
|
||||
currentContext?: string;
|
||||
cliPluginsExtraDirs?: string[];
|
||||
plugins?: Record<string, Record<string, string>>;
|
||||
aliases?: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface ProxyConfig {
|
||||
httpProxy?: string;
|
||||
httpsProxy?: string;
|
||||
noProxy?: string;
|
||||
ftpProxy?: string;
|
||||
}
|
||||
|
||||
export interface KubernetesConfig {
|
||||
allNamespaces?: string;
|
||||
}
|
||||
|
||||
export interface AuthConfig {
|
||||
username?: string;
|
||||
password?: string;
|
||||
auth?: string;
|
||||
email?: string;
|
||||
serveraddress?: string;
|
||||
identitytoken?: string;
|
||||
registrytoken?: string;
|
||||
}
|
||||
44
src/util.ts
44
src/util.ts
@@ -21,6 +21,7 @@ import {parse} from 'csv-parse/sync';
|
||||
|
||||
export interface InputListOpts {
|
||||
ignoreComma?: boolean;
|
||||
comment?: string;
|
||||
quote?: string | boolean | Buffer | null;
|
||||
}
|
||||
|
||||
@@ -36,7 +37,7 @@ export class Util {
|
||||
const records = parse(items, {
|
||||
columns: false,
|
||||
relaxQuotes: true,
|
||||
comment: '#',
|
||||
comment: opts?.comment,
|
||||
relaxColumnCount: true,
|
||||
skipEmptyLines: true,
|
||||
quote: opts?.quote
|
||||
@@ -65,13 +66,26 @@ export class Util {
|
||||
}
|
||||
}
|
||||
|
||||
public static isValidUrl(url: string): boolean {
|
||||
public static isValidURL(urlStr: string): boolean {
|
||||
let url;
|
||||
try {
|
||||
new URL(url);
|
||||
url = new URL(urlStr);
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return url.protocol === 'http:' || url.protocol === 'https:';
|
||||
}
|
||||
|
||||
public static isValidRef(refStr: string): boolean {
|
||||
if (Util.isValidURL(refStr)) {
|
||||
return true;
|
||||
}
|
||||
for (const prefix of ['git://', 'github.com/', 'git@']) {
|
||||
if (refStr.startsWith(prefix)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static async powershellCommand(script: string, params?: Record<string, string>) {
|
||||
@@ -97,4 +111,26 @@ export class Util {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static trimPrefix(str: string, suffix: string): string {
|
||||
if (!str || !suffix) {
|
||||
return str;
|
||||
}
|
||||
const index = str.indexOf(suffix);
|
||||
if (index !== 0) {
|
||||
return str;
|
||||
}
|
||||
return str.substring(suffix.length);
|
||||
}
|
||||
|
||||
public static trimSuffix(str: string, suffix: string): string {
|
||||
if (!str || !suffix) {
|
||||
return str;
|
||||
}
|
||||
const index = str.lastIndexOf(suffix);
|
||||
if (index === -1 || index + suffix.length !== str.length) {
|
||||
return str;
|
||||
}
|
||||
return str.substring(0, index);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user