Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3543c64504 | ||
|
|
eb838bda3a | ||
|
|
aa8033de8f | ||
|
|
a8cf50098a | ||
|
|
42e59b7a6c | ||
|
|
477e96d237 | ||
|
|
05e3bb5b86 | ||
|
|
11c483e5c9 | ||
|
|
491039b9e3 | ||
|
|
a777edf0f6 | ||
|
|
a60e66444e | ||
|
|
f94786cf56 | ||
|
|
09e67cefea | ||
|
|
c5fb2b6f30 | ||
|
|
1416ff392b | ||
|
|
e4b0b455d8 | ||
|
|
ce4ab4d3d2 | ||
|
|
b7405db71f | ||
|
|
fbf0d5ba85 | ||
|
|
66531a2912 | ||
|
|
1c34ae09f0 |
115
.github/buildx-releases.json
vendored
115
.github/buildx-releases.json
vendored
@@ -1,43 +1,84 @@
|
|||||||
{
|
{
|
||||||
"latest": {
|
"latest": {
|
||||||
"id": 166111587,
|
"id": 167152950,
|
||||||
"tag_name": "v0.16.1",
|
"tag_name": "v0.16.2",
|
||||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.16.1",
|
"html_url": "https://github.com/docker/buildx/releases/tag/v0.16.2",
|
||||||
"assets": [
|
"assets": [
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.darwin-amd64",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.darwin-amd64",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.darwin-amd64.provenance.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.darwin-amd64.provenance.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.darwin-amd64.sbom.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.darwin-amd64.sbom.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.darwin-arm64",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.darwin-arm64",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.darwin-arm64.provenance.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.darwin-arm64.provenance.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.darwin-arm64.sbom.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.darwin-arm64.sbom.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-amd64",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-amd64",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-amd64.provenance.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-amd64.provenance.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-amd64.sbom.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-amd64.sbom.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-arm-v6",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-arm-v6",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-arm-v6.provenance.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-arm-v6.provenance.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-arm-v6.sbom.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-arm-v6.sbom.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-arm-v7",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-arm-v7",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-arm-v7.provenance.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-arm-v7.provenance.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-arm-v7.sbom.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-arm-v7.sbom.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-arm64",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-arm64",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-arm64.provenance.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-arm64.provenance.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-arm64.sbom.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-arm64.sbom.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-ppc64le",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-ppc64le",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-ppc64le.provenance.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-ppc64le.provenance.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-ppc64le.sbom.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-ppc64le.sbom.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-riscv64",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-riscv64",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-riscv64.provenance.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-riscv64.provenance.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-riscv64.sbom.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-riscv64.sbom.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-s390x",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-s390x",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-s390x.provenance.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-s390x.provenance.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.linux-s390x.sbom.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-s390x.sbom.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.windows-amd64.exe",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.windows-amd64.exe",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.windows-amd64.provenance.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.windows-amd64.provenance.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.windows-amd64.sbom.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.windows-amd64.sbom.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.windows-arm64.exe",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.windows-arm64.exe",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.windows-arm64.provenance.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.windows-arm64.provenance.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/buildx-v0.16.1.windows-arm64.sbom.json",
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.windows-arm64.sbom.json",
|
||||||
"https://github.com/docker/buildx/releases/download/v0.16.1/checksums.txt"
|
"https://github.com/docker/buildx/releases/download/v0.16.2/checksums.txt"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"v0.16.2": {
|
||||||
|
"id": 167152950,
|
||||||
|
"tag_name": "v0.16.2",
|
||||||
|
"html_url": "https://github.com/docker/buildx/releases/tag/v0.16.2",
|
||||||
|
"assets": [
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.darwin-amd64",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.darwin-amd64.provenance.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.darwin-amd64.sbom.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.darwin-arm64",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.darwin-arm64.provenance.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.darwin-arm64.sbom.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-amd64",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-amd64.provenance.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-amd64.sbom.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-arm-v6",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-arm-v6.provenance.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-arm-v6.sbom.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-arm-v7",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-arm-v7.provenance.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-arm-v7.sbom.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-arm64",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-arm64.provenance.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-arm64.sbom.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-ppc64le",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-ppc64le.provenance.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-ppc64le.sbom.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-riscv64",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-riscv64.provenance.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-riscv64.sbom.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-s390x",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-s390x.provenance.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-s390x.sbom.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.windows-amd64.exe",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.windows-amd64.provenance.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.windows-amd64.sbom.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.windows-arm64.exe",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.windows-arm64.provenance.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.windows-arm64.sbom.json",
|
||||||
|
"https://github.com/docker/buildx/releases/download/v0.16.2/checksums.txt"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"v0.16.1": {
|
"v0.16.1": {
|
||||||
|
|||||||
30
.github/docker-releases.json
vendored
30
.github/docker-releases.json
vendored
@@ -1,8 +1,32 @@
|
|||||||
{
|
{
|
||||||
"latest": {
|
"latest": {
|
||||||
"id": 163311279,
|
"id": 166797236,
|
||||||
"tag_name": "v27.0.3",
|
"tag_name": "v27.1.1",
|
||||||
"html_url": "https://github.com/moby/moby/releases/tag/v27.0.3",
|
"html_url": "https://github.com/moby/moby/releases/tag/v27.1.1",
|
||||||
|
"assets": []
|
||||||
|
},
|
||||||
|
"v25.0.6": {
|
||||||
|
"id": 167195013,
|
||||||
|
"tag_name": "v25.0.6",
|
||||||
|
"html_url": "https://github.com/moby/moby/releases/tag/v25.0.6",
|
||||||
|
"assets": []
|
||||||
|
},
|
||||||
|
"v27.1.1": {
|
||||||
|
"id": 166797236,
|
||||||
|
"tag_name": "v27.1.1",
|
||||||
|
"html_url": "https://github.com/moby/moby/releases/tag/v27.1.1",
|
||||||
|
"assets": []
|
||||||
|
},
|
||||||
|
"v26.1.5": {
|
||||||
|
"id": 166954867,
|
||||||
|
"tag_name": "v26.1.5",
|
||||||
|
"html_url": "https://github.com/moby/moby/releases/tag/v26.1.5",
|
||||||
|
"assets": []
|
||||||
|
},
|
||||||
|
"v27.1.0": {
|
||||||
|
"id": 166495917,
|
||||||
|
"tag_name": "v27.1.0",
|
||||||
|
"html_url": "https://github.com/moby/moby/releases/tag/v27.1.0",
|
||||||
"assets": []
|
"assets": []
|
||||||
},
|
},
|
||||||
"v27.0.3": {
|
"v27.0.3": {
|
||||||
|
|||||||
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -15,8 +15,8 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
NODE_VERSION: "20"
|
NODE_VERSION: "20"
|
||||||
BUILDX_VERSION: "v0.16.1"
|
BUILDX_VERSION: "v0.16.2"
|
||||||
BUILDKIT_IMAGE: "moby/buildkit:v0.15.0"
|
BUILDKIT_IMAGE: "moby/buildkit:v0.15.1"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
|||||||
26
__tests__/.fixtures/lint-other.Dockerfile
Normal file
26
__tests__/.fixtures/lint-other.Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# syntax=docker/dockerfile-upstream:master
|
||||||
|
|
||||||
|
# Copyright 2024 actions-toolkit authors
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
frOM busybox as base
|
||||||
|
cOpy lint-other.Dockerfile .
|
||||||
|
|
||||||
|
froM busybox aS notused
|
||||||
|
COPY lint-other.Dockerfile .
|
||||||
|
|
||||||
|
from scratch
|
||||||
|
COPy --from=base \
|
||||||
|
/lint-other.Dockerfile \
|
||||||
|
/
|
||||||
26
__tests__/.fixtures/lint.hcl
Normal file
26
__tests__/.fixtures/lint.hcl
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
// Copyright 2024 actions-toolkit authors
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
group "default" {
|
||||||
|
targets = ["lint", "lint-other", "lint-inline"]
|
||||||
|
}
|
||||||
|
target "lint" {
|
||||||
|
dockerfile = "lint.Dockerfile"
|
||||||
|
}
|
||||||
|
target "lint-other" {
|
||||||
|
dockerfile = "lint-other.Dockerfile"
|
||||||
|
}
|
||||||
|
target "lint-inline" {
|
||||||
|
dockerfile-inline = "FRoM alpine\nENTRYPOINT [\"echo\", \"hello\"]"
|
||||||
|
}
|
||||||
476
__tests__/.fixtures/metadata-bake.json
Normal file
476
__tests__/.fixtures/metadata-bake.json
Normal file
@@ -0,0 +1,476 @@
|
|||||||
|
{
|
||||||
|
"buildx.build.warnings": [
|
||||||
|
{
|
||||||
|
"vertex": "sha256:a5ba072453def0016837337b14eac8e587782c88e0f40bef076f63c91aa757b4",
|
||||||
|
"level": 1,
|
||||||
|
"short": "Q29uc2lzdGVudEluc3RydWN0aW9uQ2FzaW5nOiBDb21tYW5kICdmck9NJyBzaG91bGQgbWF0Y2ggdGhlIGNhc2Ugb2YgdGhlIGNvbW1hbmQgbWFqb3JpdHkgKHVwcGVyY2FzZSkgKGxpbmUgMTcp",
|
||||||
|
"detail": [
|
||||||
|
"QWxsIGNvbW1hbmRzIHdpdGhpbiB0aGUgRG9ja2VyZmlsZSBzaG91bGQgdXNlIHRoZSBzYW1lIGNhc2luZyAoZWl0aGVyIHVwcGVyIG9yIGxvd2VyKQ=="
|
||||||
|
],
|
||||||
|
"url": "https://docs.docker.com/go/dockerfile/rule/consistent-instruction-casing/",
|
||||||
|
"sourceInfo": {
|
||||||
|
"filename": "lint-other.Dockerfile",
|
||||||
|
"data": "IyBzeW50YXg9ZG9ja2VyL2RvY2tlcmZpbGUtdXBzdHJlYW06bWFzdGVyCgojIENvcHlyaWdodCAyMDI0IGFjdGlvbnMtdG9vbGtpdCBhdXRob3JzCiMKIyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKIyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCiMgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CiMKIyAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAojCiMgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQojIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCiMgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCiMgU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAojIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgoKZnJPTSBidXN5Ym94IGFzIGJhc2UKY09weSBsaW50LW90aGVyLkRvY2tlcmZpbGUgLgoKZnJvTSBidXN5Ym94IGFTIG5vdHVzZWQKQ09QWSBsaW50LW90aGVyLkRvY2tlcmZpbGUgLgoKZnJvbSBzY3JhdGNoCkNPUHkgLS1mcm9tPWJhc2UgXAogIC9saW50LW90aGVyLkRvY2tlcmZpbGUgXAogIC8K",
|
||||||
|
"language": "Dockerfile"
|
||||||
|
},
|
||||||
|
"range": [
|
||||||
|
{
|
||||||
|
"start": {
|
||||||
|
"line": 17
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 17
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"vertex": "sha256:a5ba072453def0016837337b14eac8e587782c88e0f40bef076f63c91aa757b4",
|
||||||
|
"level": 1,
|
||||||
|
"short": "Q29uc2lzdGVudEluc3RydWN0aW9uQ2FzaW5nOiBDb21tYW5kICdmcm9NJyBzaG91bGQgbWF0Y2ggdGhlIGNhc2Ugb2YgdGhlIGNvbW1hbmQgbWFqb3JpdHkgKHVwcGVyY2FzZSkgKGxpbmUgMjAp",
|
||||||
|
"detail": [
|
||||||
|
"QWxsIGNvbW1hbmRzIHdpdGhpbiB0aGUgRG9ja2VyZmlsZSBzaG91bGQgdXNlIHRoZSBzYW1lIGNhc2luZyAoZWl0aGVyIHVwcGVyIG9yIGxvd2VyKQ=="
|
||||||
|
],
|
||||||
|
"url": "https://docs.docker.com/go/dockerfile/rule/consistent-instruction-casing/",
|
||||||
|
"sourceInfo": {
|
||||||
|
"filename": "lint-other.Dockerfile",
|
||||||
|
"data": "IyBzeW50YXg9ZG9ja2VyL2RvY2tlcmZpbGUtdXBzdHJlYW06bWFzdGVyCgojIENvcHlyaWdodCAyMDI0IGFjdGlvbnMtdG9vbGtpdCBhdXRob3JzCiMKIyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKIyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCiMgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CiMKIyAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAojCiMgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQojIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCiMgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCiMgU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAojIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgoKZnJPTSBidXN5Ym94IGFzIGJhc2UKY09weSBsaW50LW90aGVyLkRvY2tlcmZpbGUgLgoKZnJvTSBidXN5Ym94IGFTIG5vdHVzZWQKQ09QWSBsaW50LW90aGVyLkRvY2tlcmZpbGUgLgoKZnJvbSBzY3JhdGNoCkNPUHkgLS1mcm9tPWJhc2UgXAogIC9saW50LW90aGVyLkRvY2tlcmZpbGUgXAogIC8K",
|
||||||
|
"language": "Dockerfile"
|
||||||
|
},
|
||||||
|
"range": [
|
||||||
|
{
|
||||||
|
"start": {
|
||||||
|
"line": 20
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 20
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"vertex": "sha256:a5ba072453def0016837337b14eac8e587782c88e0f40bef076f63c91aa757b4",
|
||||||
|
"level": 1,
|
||||||
|
"short": "Q29uc2lzdGVudEluc3RydWN0aW9uQ2FzaW5nOiBDb21tYW5kICdDT1B5JyBzaG91bGQgbWF0Y2ggdGhlIGNhc2Ugb2YgdGhlIGNvbW1hbmQgbWFqb3JpdHkgKHVwcGVyY2FzZSkgKGxpbmUgMjQp",
|
||||||
|
"detail": [
|
||||||
|
"QWxsIGNvbW1hbmRzIHdpdGhpbiB0aGUgRG9ja2VyZmlsZSBzaG91bGQgdXNlIHRoZSBzYW1lIGNhc2luZyAoZWl0aGVyIHVwcGVyIG9yIGxvd2VyKQ=="
|
||||||
|
],
|
||||||
|
"url": "https://docs.docker.com/go/dockerfile/rule/consistent-instruction-casing/",
|
||||||
|
"sourceInfo": {
|
||||||
|
"filename": "lint-other.Dockerfile",
|
||||||
|
"data": "IyBzeW50YXg9ZG9ja2VyL2RvY2tlcmZpbGUtdXBzdHJlYW06bWFzdGVyCgojIENvcHlyaWdodCAyMDI0IGFjdGlvbnMtdG9vbGtpdCBhdXRob3JzCiMKIyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKIyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCiMgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CiMKIyAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAojCiMgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQojIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCiMgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCiMgU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAojIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgoKZnJPTSBidXN5Ym94IGFzIGJhc2UKY09weSBsaW50LW90aGVyLkRvY2tlcmZpbGUgLgoKZnJvTSBidXN5Ym94IGFTIG5vdHVzZWQKQ09QWSBsaW50LW90aGVyLkRvY2tlcmZpbGUgLgoKZnJvbSBzY3JhdGNoCkNPUHkgLS1mcm9tPWJhc2UgXAogIC9saW50LW90aGVyLkRvY2tlcmZpbGUgXAogIC8K",
|
||||||
|
"language": "Dockerfile"
|
||||||
|
},
|
||||||
|
"range": [
|
||||||
|
{
|
||||||
|
"start": {
|
||||||
|
"line": 24
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 24
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"start": {
|
||||||
|
"line": 25
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 25
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"start": {
|
||||||
|
"line": 26
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 26
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"vertex": "sha256:703fee0c090bf71539abdd28ae63eb49ced05ebd6da49db96224888f49db219d",
|
||||||
|
"level": 1,
|
||||||
|
"short": "Q29uc2lzdGVudEluc3RydWN0aW9uQ2FzaW5nOiBDb21tYW5kICdmcm9tJyBzaG91bGQgbWF0Y2ggdGhlIGNhc2Ugb2YgdGhlIGNvbW1hbmQgbWFqb3JpdHkgKHVwcGVyY2FzZSkgKGxpbmUgMjAp",
|
||||||
|
"detail": [
|
||||||
|
"QWxsIGNvbW1hbmRzIHdpdGhpbiB0aGUgRG9ja2VyZmlsZSBzaG91bGQgdXNlIHRoZSBzYW1lIGNhc2luZyAoZWl0aGVyIHVwcGVyIG9yIGxvd2VyKQ=="
|
||||||
|
],
|
||||||
|
"url": "https://docs.docker.com/go/dockerfile/rule/consistent-instruction-casing/",
|
||||||
|
"sourceInfo": {
|
||||||
|
"filename": "lint.Dockerfile",
|
||||||
|
"data": "IyBzeW50YXg9ZG9ja2VyL2RvY2tlcmZpbGUtdXBzdHJlYW06bWFzdGVyCgojIENvcHlyaWdodCAyMDI0IGFjdGlvbnMtdG9vbGtpdCBhdXRob3JzCiMKIyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKIyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCiMgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CiMKIyAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAojCiMgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQojIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCiMgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCiMgU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAojIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgoKZnJPTSBidXN5Ym94IGFzIGJhc2UKY09weSBsaW50LkRvY2tlcmZpbGUgLgoKZnJvbSBzY3JhdGNoCk1BSU5UQUlORVIgbW9ieUBleGFtcGxlLmNvbQpDT1B5IC0tZnJvbT1iYXNlIFwKICAvbGludC5Eb2NrZXJmaWxlIFwKICAvCgpDTUQgWyAiZWNobyIsICJIZWxsbywgTm9yd2F5ISIgXQpDTUQgWyAiZWNobyIsICJIZWxsbywgU3dlZGVuISIgXQpFTlRSWVBPSU5UIG15LXByb2dyYW0gc3RhcnQK",
|
||||||
|
"language": "Dockerfile"
|
||||||
|
},
|
||||||
|
"range": [
|
||||||
|
{
|
||||||
|
"start": {
|
||||||
|
"line": 20
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 20
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"vertex": "sha256:703fee0c090bf71539abdd28ae63eb49ced05ebd6da49db96224888f49db219d",
|
||||||
|
"level": 1,
|
||||||
|
"short": "TWFpbnRhaW5lckRlcHJlY2F0ZWQ6IE1haW50YWluZXIgaW5zdHJ1Y3Rpb24gaXMgZGVwcmVjYXRlZCBpbiBmYXZvciBvZiB1c2luZyBsYWJlbCAobGluZSAyMSk=",
|
||||||
|
"detail": [
|
||||||
|
"VGhlIE1BSU5UQUlORVIgaW5zdHJ1Y3Rpb24gaXMgZGVwcmVjYXRlZCwgdXNlIGEgbGFiZWwgaW5zdGVhZCB0byBkZWZpbmUgYW4gaW1hZ2UgYXV0aG9y"
|
||||||
|
],
|
||||||
|
"url": "https://docs.docker.com/go/dockerfile/rule/maintainer-deprecated/",
|
||||||
|
"sourceInfo": {
|
||||||
|
"filename": "lint.Dockerfile",
|
||||||
|
"data": "IyBzeW50YXg9ZG9ja2VyL2RvY2tlcmZpbGUtdXBzdHJlYW06bWFzdGVyCgojIENvcHlyaWdodCAyMDI0IGFjdGlvbnMtdG9vbGtpdCBhdXRob3JzCiMKIyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKIyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCiMgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CiMKIyAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAojCiMgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQojIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCiMgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCiMgU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAojIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgoKZnJPTSBidXN5Ym94IGFzIGJhc2UKY09weSBsaW50LkRvY2tlcmZpbGUgLgoKZnJvbSBzY3JhdGNoCk1BSU5UQUlORVIgbW9ieUBleGFtcGxlLmNvbQpDT1B5IC0tZnJvbT1iYXNlIFwKICAvbGludC5Eb2NrZXJmaWxlIFwKICAvCgpDTUQgWyAiZWNobyIsICJIZWxsbywgTm9yd2F5ISIgXQpDTUQgWyAiZWNobyIsICJIZWxsbywgU3dlZGVuISIgXQpFTlRSWVBPSU5UIG15LXByb2dyYW0gc3RhcnQK",
|
||||||
|
"language": "Dockerfile"
|
||||||
|
},
|
||||||
|
"range": [
|
||||||
|
{
|
||||||
|
"start": {
|
||||||
|
"line": 21
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 21
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"vertex": "sha256:703fee0c090bf71539abdd28ae63eb49ced05ebd6da49db96224888f49db219d",
|
||||||
|
"level": 1,
|
||||||
|
"short": "TXVsdGlwbGVJbnN0cnVjdGlvbnNEaXNhbGxvd2VkOiBNdWx0aXBsZSBDTUQgaW5zdHJ1Y3Rpb25zIHNob3VsZCBub3QgYmUgdXNlZCBpbiB0aGUgc2FtZSBzdGFnZSBiZWNhdXNlIG9ubHkgdGhlIGxhc3Qgb25lIHdpbGwgYmUgdXNlZCAobGluZSAyNik=",
|
||||||
|
"detail": [
|
||||||
|
"TXVsdGlwbGUgaW5zdHJ1Y3Rpb25zIG9mIHRoZSBzYW1lIHR5cGUgc2hvdWxkIG5vdCBiZSB1c2VkIGluIHRoZSBzYW1lIHN0YWdl"
|
||||||
|
],
|
||||||
|
"url": "https://docs.docker.com/go/dockerfile/rule/multiple-instructions-disallowed/",
|
||||||
|
"sourceInfo": {
|
||||||
|
"filename": "lint.Dockerfile",
|
||||||
|
"data": "IyBzeW50YXg9ZG9ja2VyL2RvY2tlcmZpbGUtdXBzdHJlYW06bWFzdGVyCgojIENvcHlyaWdodCAyMDI0IGFjdGlvbnMtdG9vbGtpdCBhdXRob3JzCiMKIyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKIyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCiMgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CiMKIyAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAojCiMgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQojIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCiMgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCiMgU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAojIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgoKZnJPTSBidXN5Ym94IGFzIGJhc2UKY09weSBsaW50LkRvY2tlcmZpbGUgLgoKZnJvbSBzY3JhdGNoCk1BSU5UQUlORVIgbW9ieUBleGFtcGxlLmNvbQpDT1B5IC0tZnJvbT1iYXNlIFwKICAvbGludC5Eb2NrZXJmaWxlIFwKICAvCgpDTUQgWyAiZWNobyIsICJIZWxsbywgTm9yd2F5ISIgXQpDTUQgWyAiZWNobyIsICJIZWxsbywgU3dlZGVuISIgXQpFTlRSWVBPSU5UIG15LXByb2dyYW0gc3RhcnQK",
|
||||||
|
"language": "Dockerfile"
|
||||||
|
},
|
||||||
|
"range": [
|
||||||
|
{
|
||||||
|
"start": {
|
||||||
|
"line": 26
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 26
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"vertex": "sha256:703fee0c090bf71539abdd28ae63eb49ced05ebd6da49db96224888f49db219d",
|
||||||
|
"level": 1,
|
||||||
|
"short": "SlNPTkFyZ3NSZWNvbW1lbmRlZDogSlNPTiBhcmd1bWVudHMgcmVjb21tZW5kZWQgZm9yIEVOVFJZUE9JTlQgdG8gcHJldmVudCB1bmludGVuZGVkIGJlaGF2aW9yIHJlbGF0ZWQgdG8gT1Mgc2lnbmFscyAobGluZSAyOCk=",
|
||||||
|
"detail": [
|
||||||
|
"SlNPTiBhcmd1bWVudHMgcmVjb21tZW5kZWQgZm9yIEVOVFJZUE9JTlQvQ01EIHRvIHByZXZlbnQgdW5pbnRlbmRlZCBiZWhhdmlvciByZWxhdGVkIHRvIE9TIHNpZ25hbHM="
|
||||||
|
],
|
||||||
|
"url": "https://docs.docker.com/go/dockerfile/rule/json-args-recommended/",
|
||||||
|
"sourceInfo": {
|
||||||
|
"filename": "lint.Dockerfile",
|
||||||
|
"data": "IyBzeW50YXg9ZG9ja2VyL2RvY2tlcmZpbGUtdXBzdHJlYW06bWFzdGVyCgojIENvcHlyaWdodCAyMDI0IGFjdGlvbnMtdG9vbGtpdCBhdXRob3JzCiMKIyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKIyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCiMgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CiMKIyAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAojCiMgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQojIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCiMgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCiMgU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAojIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgoKZnJPTSBidXN5Ym94IGFzIGJhc2UKY09weSBsaW50LkRvY2tlcmZpbGUgLgoKZnJvbSBzY3JhdGNoCk1BSU5UQUlORVIgbW9ieUBleGFtcGxlLmNvbQpDT1B5IC0tZnJvbT1iYXNlIFwKICAvbGludC5Eb2NrZXJmaWxlIFwKICAvCgpDTUQgWyAiZWNobyIsICJIZWxsbywgTm9yd2F5ISIgXQpDTUQgWyAiZWNobyIsICJIZWxsbywgU3dlZGVuISIgXQpFTlRSWVBPSU5UIG15LXByb2dyYW0gc3RhcnQK",
|
||||||
|
"language": "Dockerfile"
|
||||||
|
},
|
||||||
|
"range": [
|
||||||
|
{
|
||||||
|
"start": {
|
||||||
|
"line": 28
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 28
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"vertex": "sha256:a14452ec03a7f128fb0a1da8c4afdc78175fa9a97ff83ace427b3c39509d459b",
|
||||||
|
"level": 1,
|
||||||
|
"short": "Q29uc2lzdGVudEluc3RydWN0aW9uQ2FzaW5nOiBDb21tYW5kICdGUm9NJyBzaG91bGQgbWF0Y2ggdGhlIGNhc2Ugb2YgdGhlIGNvbW1hbmQgbWFqb3JpdHkgKHVwcGVyY2FzZSkgKGxpbmUgMSk=",
|
||||||
|
"detail": [
|
||||||
|
"QWxsIGNvbW1hbmRzIHdpdGhpbiB0aGUgRG9ja2VyZmlsZSBzaG91bGQgdXNlIHRoZSBzYW1lIGNhc2luZyAoZWl0aGVyIHVwcGVyIG9yIGxvd2VyKQ=="
|
||||||
|
],
|
||||||
|
"url": "https://docs.docker.com/go/dockerfile/rule/consistent-instruction-casing/",
|
||||||
|
"sourceInfo": {
|
||||||
|
"filename": "Dockerfile",
|
||||||
|
"data": "RlJvTSBhbHBpbmUKRU5UUllQT0lOVCBbImVjaG8iLCAiaGVsbG8iXQ==",
|
||||||
|
"language": "Dockerfile"
|
||||||
|
},
|
||||||
|
"range": [
|
||||||
|
{
|
||||||
|
"start": {
|
||||||
|
"line": 1
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"vertex": "sha256:a5ba072453def0016837337b14eac8e587782c88e0f40bef076f63c91aa757b4",
|
||||||
|
"level": 1,
|
||||||
|
"short": "Q29uc2lzdGVudEluc3RydWN0aW9uQ2FzaW5nOiBDb21tYW5kICdmcm9tJyBzaG91bGQgbWF0Y2ggdGhlIGNhc2Ugb2YgdGhlIGNvbW1hbmQgbWFqb3JpdHkgKHVwcGVyY2FzZSkgKGxpbmUgMjMp",
|
||||||
|
"detail": [
|
||||||
|
"QWxsIGNvbW1hbmRzIHdpdGhpbiB0aGUgRG9ja2VyZmlsZSBzaG91bGQgdXNlIHRoZSBzYW1lIGNhc2luZyAoZWl0aGVyIHVwcGVyIG9yIGxvd2VyKQ=="
|
||||||
|
],
|
||||||
|
"url": "https://docs.docker.com/go/dockerfile/rule/consistent-instruction-casing/",
|
||||||
|
"sourceInfo": {
|
||||||
|
"filename": "lint-other.Dockerfile",
|
||||||
|
"data": "IyBzeW50YXg9ZG9ja2VyL2RvY2tlcmZpbGUtdXBzdHJlYW06bWFzdGVyCgojIENvcHlyaWdodCAyMDI0IGFjdGlvbnMtdG9vbGtpdCBhdXRob3JzCiMKIyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKIyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCiMgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CiMKIyAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAojCiMgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQojIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCiMgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCiMgU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAojIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgoKZnJPTSBidXN5Ym94IGFzIGJhc2UKY09weSBsaW50LW90aGVyLkRvY2tlcmZpbGUgLgoKZnJvTSBidXN5Ym94IGFTIG5vdHVzZWQKQ09QWSBsaW50LW90aGVyLkRvY2tlcmZpbGUgLgoKZnJvbSBzY3JhdGNoCkNPUHkgLS1mcm9tPWJhc2UgXAogIC9saW50LW90aGVyLkRvY2tlcmZpbGUgXAogIC8K",
|
||||||
|
"language": "Dockerfile"
|
||||||
|
},
|
||||||
|
"range": [
|
||||||
|
{
|
||||||
|
"start": {
|
||||||
|
"line": 23
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 23
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"vertex": "sha256:703fee0c090bf71539abdd28ae63eb49ced05ebd6da49db96224888f49db219d",
|
||||||
|
"level": 1,
|
||||||
|
"short": "Q29uc2lzdGVudEluc3RydWN0aW9uQ2FzaW5nOiBDb21tYW5kICdmck9NJyBzaG91bGQgbWF0Y2ggdGhlIGNhc2Ugb2YgdGhlIGNvbW1hbmQgbWFqb3JpdHkgKHVwcGVyY2FzZSkgKGxpbmUgMTcp",
|
||||||
|
"detail": [
|
||||||
|
"QWxsIGNvbW1hbmRzIHdpdGhpbiB0aGUgRG9ja2VyZmlsZSBzaG91bGQgdXNlIHRoZSBzYW1lIGNhc2luZyAoZWl0aGVyIHVwcGVyIG9yIGxvd2VyKQ=="
|
||||||
|
],
|
||||||
|
"url": "https://docs.docker.com/go/dockerfile/rule/consistent-instruction-casing/",
|
||||||
|
"sourceInfo": {
|
||||||
|
"filename": "lint.Dockerfile",
|
||||||
|
"data": "IyBzeW50YXg9ZG9ja2VyL2RvY2tlcmZpbGUtdXBzdHJlYW06bWFzdGVyCgojIENvcHlyaWdodCAyMDI0IGFjdGlvbnMtdG9vbGtpdCBhdXRob3JzCiMKIyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKIyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCiMgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CiMKIyAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAojCiMgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQojIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCiMgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCiMgU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAojIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgoKZnJPTSBidXN5Ym94IGFzIGJhc2UKY09weSBsaW50LkRvY2tlcmZpbGUgLgoKZnJvbSBzY3JhdGNoCk1BSU5UQUlORVIgbW9ieUBleGFtcGxlLmNvbQpDT1B5IC0tZnJvbT1iYXNlIFwKICAvbGludC5Eb2NrZXJmaWxlIFwKICAvCgpDTUQgWyAiZWNobyIsICJIZWxsbywgTm9yd2F5ISIgXQpDTUQgWyAiZWNobyIsICJIZWxsbywgU3dlZGVuISIgXQpFTlRSWVBPSU5UIG15LXByb2dyYW0gc3RhcnQK",
|
||||||
|
"language": "Dockerfile"
|
||||||
|
},
|
||||||
|
"range": [
|
||||||
|
{
|
||||||
|
"start": {
|
||||||
|
"line": 17
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 17
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"vertex": "sha256:703fee0c090bf71539abdd28ae63eb49ced05ebd6da49db96224888f49db219d",
|
||||||
|
"level": 1,
|
||||||
|
"short": "Q29uc2lzdGVudEluc3RydWN0aW9uQ2FzaW5nOiBDb21tYW5kICdjT3B5JyBzaG91bGQgbWF0Y2ggdGhlIGNhc2Ugb2YgdGhlIGNvbW1hbmQgbWFqb3JpdHkgKHVwcGVyY2FzZSkgKGxpbmUgMTgp",
|
||||||
|
"detail": [
|
||||||
|
"QWxsIGNvbW1hbmRzIHdpdGhpbiB0aGUgRG9ja2VyZmlsZSBzaG91bGQgdXNlIHRoZSBzYW1lIGNhc2luZyAoZWl0aGVyIHVwcGVyIG9yIGxvd2VyKQ=="
|
||||||
|
],
|
||||||
|
"url": "https://docs.docker.com/go/dockerfile/rule/consistent-instruction-casing/",
|
||||||
|
"sourceInfo": {
|
||||||
|
"filename": "lint.Dockerfile",
|
||||||
|
"data": "IyBzeW50YXg9ZG9ja2VyL2RvY2tlcmZpbGUtdXBzdHJlYW06bWFzdGVyCgojIENvcHlyaWdodCAyMDI0IGFjdGlvbnMtdG9vbGtpdCBhdXRob3JzCiMKIyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKIyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCiMgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CiMKIyAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAojCiMgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQojIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCiMgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCiMgU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAojIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgoKZnJPTSBidXN5Ym94IGFzIGJhc2UKY09weSBsaW50LkRvY2tlcmZpbGUgLgoKZnJvbSBzY3JhdGNoCk1BSU5UQUlORVIgbW9ieUBleGFtcGxlLmNvbQpDT1B5IC0tZnJvbT1iYXNlIFwKICAvbGludC5Eb2NrZXJmaWxlIFwKICAvCgpDTUQgWyAiZWNobyIsICJIZWxsbywgTm9yd2F5ISIgXQpDTUQgWyAiZWNobyIsICJIZWxsbywgU3dlZGVuISIgXQpFTlRSWVBPSU5UIG15LXByb2dyYW0gc3RhcnQK",
|
||||||
|
"language": "Dockerfile"
|
||||||
|
},
|
||||||
|
"range": [
|
||||||
|
{
|
||||||
|
"start": {
|
||||||
|
"line": 18
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 18
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"vertex": "sha256:703fee0c090bf71539abdd28ae63eb49ced05ebd6da49db96224888f49db219d",
|
||||||
|
"level": 1,
|
||||||
|
"short": "Q29uc2lzdGVudEluc3RydWN0aW9uQ2FzaW5nOiBDb21tYW5kICdDT1B5JyBzaG91bGQgbWF0Y2ggdGhlIGNhc2Ugb2YgdGhlIGNvbW1hbmQgbWFqb3JpdHkgKHVwcGVyY2FzZSkgKGxpbmUgMjIp",
|
||||||
|
"detail": [
|
||||||
|
"QWxsIGNvbW1hbmRzIHdpdGhpbiB0aGUgRG9ja2VyZmlsZSBzaG91bGQgdXNlIHRoZSBzYW1lIGNhc2luZyAoZWl0aGVyIHVwcGVyIG9yIGxvd2VyKQ=="
|
||||||
|
],
|
||||||
|
"url": "https://docs.docker.com/go/dockerfile/rule/consistent-instruction-casing/",
|
||||||
|
"sourceInfo": {
|
||||||
|
"filename": "lint.Dockerfile",
|
||||||
|
"data": "IyBzeW50YXg9ZG9ja2VyL2RvY2tlcmZpbGUtdXBzdHJlYW06bWFzdGVyCgojIENvcHlyaWdodCAyMDI0IGFjdGlvbnMtdG9vbGtpdCBhdXRob3JzCiMKIyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKIyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCiMgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CiMKIyAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAojCiMgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQojIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCiMgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCiMgU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAojIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgoKZnJPTSBidXN5Ym94IGFzIGJhc2UKY09weSBsaW50LkRvY2tlcmZpbGUgLgoKZnJvbSBzY3JhdGNoCk1BSU5UQUlORVIgbW9ieUBleGFtcGxlLmNvbQpDT1B5IC0tZnJvbT1iYXNlIFwKICAvbGludC5Eb2NrZXJmaWxlIFwKICAvCgpDTUQgWyAiZWNobyIsICJIZWxsbywgTm9yd2F5ISIgXQpDTUQgWyAiZWNobyIsICJIZWxsbywgU3dlZGVuISIgXQpFTlRSWVBPSU5UIG15LXByb2dyYW0gc3RhcnQK",
|
||||||
|
"language": "Dockerfile"
|
||||||
|
},
|
||||||
|
"range": [
|
||||||
|
{
|
||||||
|
"start": {
|
||||||
|
"line": 22
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 22
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"start": {
|
||||||
|
"line": 23
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 23
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"start": {
|
||||||
|
"line": 24
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 24
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"vertex": "sha256:a5ba072453def0016837337b14eac8e587782c88e0f40bef076f63c91aa757b4",
|
||||||
|
"level": 1,
|
||||||
|
"short": "Q29uc2lzdGVudEluc3RydWN0aW9uQ2FzaW5nOiBDb21tYW5kICdjT3B5JyBzaG91bGQgbWF0Y2ggdGhlIGNhc2Ugb2YgdGhlIGNvbW1hbmQgbWFqb3JpdHkgKHVwcGVyY2FzZSkgKGxpbmUgMTgp",
|
||||||
|
"detail": [
|
||||||
|
"QWxsIGNvbW1hbmRzIHdpdGhpbiB0aGUgRG9ja2VyZmlsZSBzaG91bGQgdXNlIHRoZSBzYW1lIGNhc2luZyAoZWl0aGVyIHVwcGVyIG9yIGxvd2VyKQ=="
|
||||||
|
],
|
||||||
|
"url": "https://docs.docker.com/go/dockerfile/rule/consistent-instruction-casing/",
|
||||||
|
"sourceInfo": {
|
||||||
|
"filename": "lint-other.Dockerfile",
|
||||||
|
"data": "IyBzeW50YXg9ZG9ja2VyL2RvY2tlcmZpbGUtdXBzdHJlYW06bWFzdGVyCgojIENvcHlyaWdodCAyMDI0IGFjdGlvbnMtdG9vbGtpdCBhdXRob3JzCiMKIyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKIyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCiMgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CiMKIyAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAojCiMgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQojIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCiMgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCiMgU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAojIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgoKZnJPTSBidXN5Ym94IGFzIGJhc2UKY09weSBsaW50LW90aGVyLkRvY2tlcmZpbGUgLgoKZnJvTSBidXN5Ym94IGFTIG5vdHVzZWQKQ09QWSBsaW50LW90aGVyLkRvY2tlcmZpbGUgLgoKZnJvbSBzY3JhdGNoCkNPUHkgLS1mcm9tPWJhc2UgXAogIC9saW50LW90aGVyLkRvY2tlcmZpbGUgXAogIC8K",
|
||||||
|
"language": "Dockerfile"
|
||||||
|
},
|
||||||
|
"range": [
|
||||||
|
{
|
||||||
|
"start": {
|
||||||
|
"line": 18
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 18
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"lint": {
|
||||||
|
"buildx.build.provenance": {
|
||||||
|
"buildType": "https://mobyproject.org/buildkit@v1",
|
||||||
|
"materials": [
|
||||||
|
{
|
||||||
|
"uri": "pkg:docker/docker/dockerfile-upstream@master",
|
||||||
|
"digest": {
|
||||||
|
"sha256": "bcfc291ad4ebc0fb1f53d2b2e4a4f6ba5a6a5df61d8a501aa6edb18f8dec339f"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uri": "pkg:docker/busybox@latest?platform=linux%2Famd64",
|
||||||
|
"digest": {
|
||||||
|
"sha256": "9ae97d36d26566ff84e8893c64a6dc4fe8ca6d1144bf5b87b2b85a32def253c7"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"invocation": {
|
||||||
|
"configSource": {
|
||||||
|
"entryPoint": "lint.Dockerfile"
|
||||||
|
},
|
||||||
|
"parameters": {
|
||||||
|
"frontend": "gateway.v0",
|
||||||
|
"args": {
|
||||||
|
"cmdline": "docker/dockerfile-upstream:master",
|
||||||
|
"source": "docker/dockerfile-upstream:master"
|
||||||
|
},
|
||||||
|
"locals": [
|
||||||
|
{
|
||||||
|
"name": "context"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dockerfile"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"platform": "linux/amd64"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"buildx.build.ref": "default/default/x3tig9yrbzg2bp0ahn840m9hs",
|
||||||
|
"containerimage.config.digest": "sha256:0c1ae53d25e7cad9c1d81de558cdf959dfaf49e32d6918984eae14ae33197c2f",
|
||||||
|
"containerimage.digest": "sha256:0c1ae53d25e7cad9c1d81de558cdf959dfaf49e32d6918984eae14ae33197c2f"
|
||||||
|
},
|
||||||
|
"lint-inline": {
|
||||||
|
"buildx.build.provenance": {
|
||||||
|
"buildType": "https://mobyproject.org/buildkit@v1",
|
||||||
|
"materials": [
|
||||||
|
{
|
||||||
|
"uri": "pkg:docker/alpine@latest?platform=linux%2Famd64",
|
||||||
|
"digest": {
|
||||||
|
"sha256": "94e5f06ff8e3d4441dc3cd8b090ff38dc911bfa8ebdb0dc28395bc98f82f983f"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"invocation": {
|
||||||
|
"configSource": {
|
||||||
|
"entryPoint": "Dockerfile"
|
||||||
|
},
|
||||||
|
"parameters": {
|
||||||
|
"frontend": "dockerfile.v0",
|
||||||
|
"args": {
|
||||||
|
"dockerfilekey": "dockerfile"
|
||||||
|
},
|
||||||
|
"locals": [
|
||||||
|
{
|
||||||
|
"name": "context"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dockerfile"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"platform": "linux/amd64"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"buildx.build.ref": "default/default/f9i6og3j529lrezk83aw9k8fr",
|
||||||
|
"containerimage.config.digest": "sha256:b91f245896946759eb112149602f5638a9263d0ebc3d5e8b46533960494bda32",
|
||||||
|
"containerimage.digest": "sha256:b91f245896946759eb112149602f5638a9263d0ebc3d5e8b46533960494bda32"
|
||||||
|
},
|
||||||
|
"lint-other": {
|
||||||
|
"buildx.build.provenance": {
|
||||||
|
"buildType": "https://mobyproject.org/buildkit@v1",
|
||||||
|
"materials": [
|
||||||
|
{
|
||||||
|
"uri": "pkg:docker/docker/dockerfile-upstream@master",
|
||||||
|
"digest": {
|
||||||
|
"sha256": "bcfc291ad4ebc0fb1f53d2b2e4a4f6ba5a6a5df61d8a501aa6edb18f8dec339f"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uri": "pkg:docker/busybox@latest?platform=linux%2Famd64",
|
||||||
|
"digest": {
|
||||||
|
"sha256": "9ae97d36d26566ff84e8893c64a6dc4fe8ca6d1144bf5b87b2b85a32def253c7"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"invocation": {
|
||||||
|
"configSource": {
|
||||||
|
"entryPoint": "lint-other.Dockerfile"
|
||||||
|
},
|
||||||
|
"parameters": {
|
||||||
|
"frontend": "gateway.v0",
|
||||||
|
"args": {
|
||||||
|
"cmdline": "docker/dockerfile-upstream:master",
|
||||||
|
"source": "docker/dockerfile-upstream:master"
|
||||||
|
},
|
||||||
|
"locals": [
|
||||||
|
{
|
||||||
|
"name": "context"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dockerfile"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"platform": "linux/amd64"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"buildx.build.ref": "default/default/yfq4itxr5kgustkcmp8jr4b9m",
|
||||||
|
"containerimage.config.digest": "sha256:897b83786d8d9158cd652f8ea0d3c8efcd098273d74f6fb9daa6904144a31537",
|
||||||
|
"containerimage.digest": "sha256:897b83786d8d9158cd652f8ea0d3c8efcd098273d74f6fb9daa6904144a31537"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,22 +15,20 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {describe, expect, jest, test, afterEach} from '@jest/globals';
|
import {describe, expect, jest, test, afterEach} from '@jest/globals';
|
||||||
import * as fs from 'fs';
|
import fs from 'fs';
|
||||||
import * as path from 'path';
|
import os from 'os';
|
||||||
|
import path from 'path';
|
||||||
import * as rimraf from 'rimraf';
|
import * as rimraf from 'rimraf';
|
||||||
|
|
||||||
import {BuildKit} from '../../src/buildkit/buildkit';
|
import {BuildKit} from '../../src/buildkit/buildkit';
|
||||||
import {Context} from '../../src/context';
|
import {Context} from '../../src/context';
|
||||||
|
|
||||||
const fixturesDir = path.join(__dirname, '..', 'fixtures');
|
const fixturesDir = path.join(__dirname, '..', '.fixtures');
|
||||||
// prettier-ignore
|
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'buildkit-config-'));
|
||||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'buildkit-config-jest');
|
|
||||||
const tmpName = path.join(tmpDir, '.tmpname-jest');
|
const tmpName = path.join(tmpDir, '.tmpname-jest');
|
||||||
|
|
||||||
jest.spyOn(Context, 'tmpDir').mockImplementation((): string => {
|
jest.spyOn(Context, 'tmpDir').mockImplementation((): string => {
|
||||||
if (!fs.existsSync(tmpDir)) {
|
fs.mkdirSync(tmpDir, {recursive: true});
|
||||||
fs.mkdirSync(tmpDir, {recursive: true});
|
|
||||||
}
|
|
||||||
return tmpDir;
|
return tmpDir;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import * as path from 'path';
|
|||||||
import {Bake} from '../../src/buildx/bake';
|
import {Bake} from '../../src/buildx/bake';
|
||||||
import {BakeDefinition} from '../../src/types/buildx/bake';
|
import {BakeDefinition} from '../../src/types/buildx/bake';
|
||||||
|
|
||||||
const fixturesDir = path.join(__dirname, '..', 'fixtures');
|
const fixturesDir = path.join(__dirname, '..', '.fixtures');
|
||||||
|
|
||||||
const maybe = !process.env.GITHUB_ACTIONS || (process.env.GITHUB_ACTIONS === 'true' && process.env.ImageOS && process.env.ImageOS.startsWith('ubuntu')) ? describe : describe.skip;
|
const maybe = !process.env.GITHUB_ACTIONS || (process.env.GITHUB_ACTIONS === 'true' && process.env.ImageOS && process.env.ImageOS.startsWith('ubuntu')) ? describe : describe.skip;
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {afterEach, describe, expect, it, jest, test} from '@jest/globals';
|
import {afterEach, describe, expect, it, jest, test} from '@jest/globals';
|
||||||
import * as fs from 'fs';
|
import fs from 'fs';
|
||||||
import * as path from 'path';
|
import os from 'os';
|
||||||
|
import path from 'path';
|
||||||
import * as rimraf from 'rimraf';
|
import * as rimraf from 'rimraf';
|
||||||
|
|
||||||
import {Bake} from '../../src/buildx/bake';
|
import {Bake} from '../../src/buildx/bake';
|
||||||
@@ -26,23 +27,13 @@ import {ExecOptions} from '@actions/exec';
|
|||||||
import {BakeDefinition} from '../../src/types/buildx/bake';
|
import {BakeDefinition} from '../../src/types/buildx/bake';
|
||||||
import {BuildMetadata} from '../../src/types/buildx/build';
|
import {BuildMetadata} from '../../src/types/buildx/build';
|
||||||
|
|
||||||
const fixturesDir = path.join(__dirname, '..', 'fixtures');
|
const fixturesDir = path.join(__dirname, '..', '.fixtures');
|
||||||
// prettier-ignore
|
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'buildx-bake-'));
|
||||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'buildx-inputs-jest');
|
|
||||||
const tmpName = path.join(tmpDir, '.tmpname-jest');
|
const tmpName = path.join(tmpDir, '.tmpname-jest');
|
||||||
const metadata: BuildMetadata = {
|
const metadata = JSON.parse(fs.readFileSync(path.join(fixturesDir, 'metadata-bake.json'), 'utf-8'));
|
||||||
app: {
|
|
||||||
'buildx.build.ref': 'default/default/7frbdw1fmfozgtqavghowsepk'
|
|
||||||
},
|
|
||||||
db: {
|
|
||||||
'buildx.build.ref': 'default/default/onic7g2axylf56rxetob7qruy'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
jest.spyOn(Context, 'tmpDir').mockImplementation((): string => {
|
jest.spyOn(Context, 'tmpDir').mockImplementation((): string => {
|
||||||
if (!fs.existsSync(tmpDir)) {
|
fs.mkdirSync(tmpDir, {recursive: true});
|
||||||
fs.mkdirSync(tmpDir, {recursive: true});
|
|
||||||
}
|
|
||||||
return tmpDir;
|
return tmpDir;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -66,7 +57,17 @@ describe('resolveRefs', () => {
|
|||||||
it('matches', async () => {
|
it('matches', async () => {
|
||||||
const bake = new Bake();
|
const bake = new Bake();
|
||||||
fs.writeFileSync(bake.getMetadataFilePath(), JSON.stringify(metadata));
|
fs.writeFileSync(bake.getMetadataFilePath(), JSON.stringify(metadata));
|
||||||
expect(bake.resolveRefs()).toEqual(['default/default/7frbdw1fmfozgtqavghowsepk', 'default/default/onic7g2axylf56rxetob7qruy']);
|
expect(bake.resolveRefs()).toEqual(['default/default/x3tig9yrbzg2bp0ahn840m9hs', 'default/default/f9i6og3j529lrezk83aw9k8fr', 'default/default/yfq4itxr5kgustkcmp8jr4b9m']);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('resolveWarnings', () => {
|
||||||
|
it('matches', async () => {
|
||||||
|
const bake = new Bake();
|
||||||
|
fs.writeFileSync(bake.getMetadataFilePath(), JSON.stringify(metadata));
|
||||||
|
const warnings = bake.resolveWarnings();
|
||||||
|
expect(warnings).toBeDefined();
|
||||||
|
expect(warnings?.length).toEqual(13);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -15,23 +15,21 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {afterEach, beforeEach, describe, expect, it, jest, test} from '@jest/globals';
|
import {afterEach, beforeEach, describe, expect, it, jest, test} from '@jest/globals';
|
||||||
import * as fs from 'fs';
|
import fs from 'fs';
|
||||||
import * as path from 'path';
|
import os from 'os';
|
||||||
|
import path from 'path';
|
||||||
import * as rimraf from 'rimraf';
|
import * as rimraf from 'rimraf';
|
||||||
|
|
||||||
import {Context} from '../../src/context';
|
import {Context} from '../../src/context';
|
||||||
import {Build} from '../../src/buildx/build';
|
import {Build} from '../../src/buildx/build';
|
||||||
|
|
||||||
const fixturesDir = path.join(__dirname, '..', 'fixtures');
|
const fixturesDir = path.join(__dirname, '..', '.fixtures');
|
||||||
// prettier-ignore
|
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'buildx-build-'));
|
||||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'buildx-inputs-jest');
|
|
||||||
const tmpName = path.join(tmpDir, '.tmpname-jest');
|
const tmpName = path.join(tmpDir, '.tmpname-jest');
|
||||||
const metadata = JSON.parse(fs.readFileSync(path.join(fixturesDir, 'metadata.json'), 'utf-8'));
|
const metadata = JSON.parse(fs.readFileSync(path.join(fixturesDir, 'metadata-build.json'), 'utf-8'));
|
||||||
|
|
||||||
jest.spyOn(Context, 'tmpDir').mockImplementation((): string => {
|
jest.spyOn(Context, 'tmpDir').mockImplementation((): string => {
|
||||||
if (!fs.existsSync(tmpDir)) {
|
fs.mkdirSync(tmpDir, {recursive: true});
|
||||||
fs.mkdirSync(tmpDir, {recursive: true});
|
|
||||||
}
|
|
||||||
return tmpDir;
|
return tmpDir;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import {Exec} from '../../src/exec';
|
|||||||
|
|
||||||
import {BuilderInfo} from '../../src/types/buildx/builder';
|
import {BuilderInfo} from '../../src/types/buildx/builder';
|
||||||
|
|
||||||
const fixturesDir = path.join(__dirname, '..', 'fixtures');
|
const fixturesDir = path.join(__dirname, '..', '.fixtures');
|
||||||
|
|
||||||
jest.spyOn(Builder.prototype, 'inspect').mockImplementation(async (): Promise<BuilderInfo> => {
|
jest.spyOn(Builder.prototype, 'inspect').mockImplementation(async (): Promise<BuilderInfo> => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
116
__tests__/buildx/buildx.test.itg.ts
Normal file
116
__tests__/buildx/buildx.test.itg.ts
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 2024 actions-toolkit authors
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {describe, expect, it} from '@jest/globals';
|
||||||
|
import fs from 'fs';
|
||||||
|
import os from 'os';
|
||||||
|
import path from 'path';
|
||||||
|
import * as core from '@actions/core';
|
||||||
|
|
||||||
|
import {Buildx} from '../../src/buildx/buildx';
|
||||||
|
import {Build} from '../../src/buildx/build';
|
||||||
|
import {Bake} from '../../src/buildx/bake';
|
||||||
|
import {Exec} from '../../src/exec';
|
||||||
|
|
||||||
|
const fixturesDir = path.join(__dirname, '..', '.fixtures');
|
||||||
|
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'buildx-buildx-itg-'));
|
||||||
|
|
||||||
|
const maybe = !process.env.GITHUB_ACTIONS || (process.env.GITHUB_ACTIONS === 'true' && process.env.ImageOS && process.env.ImageOS.startsWith('ubuntu')) ? describe : describe.skip;
|
||||||
|
|
||||||
|
maybe('convertWarningsToGitHubAnnotations', () => {
|
||||||
|
it('build lint issues', async () => {
|
||||||
|
const buildx = new Buildx();
|
||||||
|
const build = new Build({buildx: buildx});
|
||||||
|
|
||||||
|
fs.mkdirSync(tmpDir, {recursive: true});
|
||||||
|
await expect(
|
||||||
|
(async () => {
|
||||||
|
// prettier-ignore
|
||||||
|
const buildCmd = await buildx.getCommand([
|
||||||
|
'--builder', process.env.CTN_BUILDER_NAME ?? 'default',
|
||||||
|
'build',
|
||||||
|
'-f', path.join(fixturesDir, 'lint.Dockerfile'),
|
||||||
|
fixturesDir,
|
||||||
|
'--metadata-file', build.getMetadataFilePath()
|
||||||
|
]);
|
||||||
|
await Exec.exec(buildCmd.command, buildCmd.args, {
|
||||||
|
env: Object.assign({}, process.env, {
|
||||||
|
BUILDX_METADATA_WARNINGS: 'true'
|
||||||
|
}) as {
|
||||||
|
[key: string]: string;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})()
|
||||||
|
).resolves.not.toThrow();
|
||||||
|
|
||||||
|
const metadata = build.resolveMetadata();
|
||||||
|
expect(metadata).toBeDefined();
|
||||||
|
const buildRef = build.resolveRef(metadata);
|
||||||
|
expect(buildRef).toBeDefined();
|
||||||
|
const buildWarnings = build.resolveWarnings(metadata);
|
||||||
|
expect(buildWarnings).toBeDefined();
|
||||||
|
|
||||||
|
const annotations = await Buildx.convertWarningsToGitHubAnnotations(buildWarnings ?? [], [buildRef ?? '']);
|
||||||
|
expect(annotations).toBeDefined();
|
||||||
|
expect(annotations?.length).toBeGreaterThan(0);
|
||||||
|
|
||||||
|
for (const annotation of annotations ?? []) {
|
||||||
|
core.warning(annotation.message, annotation);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
it('bake lint issues', async () => {
|
||||||
|
const buildx = new Buildx();
|
||||||
|
const bake = new Bake({buildx: buildx});
|
||||||
|
|
||||||
|
fs.mkdirSync(tmpDir, {recursive: true});
|
||||||
|
await expect(
|
||||||
|
(async () => {
|
||||||
|
// prettier-ignore
|
||||||
|
const buildCmd = await buildx.getCommand([
|
||||||
|
'--builder', process.env.CTN_BUILDER_NAME ?? 'default',
|
||||||
|
'bake',
|
||||||
|
'-f', path.join(fixturesDir, 'lint.hcl'),
|
||||||
|
'--metadata-file', bake.getMetadataFilePath()
|
||||||
|
]);
|
||||||
|
await Exec.exec(buildCmd.command, buildCmd.args, {
|
||||||
|
cwd: fixturesDir,
|
||||||
|
env: Object.assign({}, process.env, {
|
||||||
|
BUILDX_METADATA_WARNINGS: 'true'
|
||||||
|
}) as {
|
||||||
|
[key: string]: string;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})()
|
||||||
|
).resolves.not.toThrow();
|
||||||
|
|
||||||
|
const metadata = bake.resolveMetadata();
|
||||||
|
expect(metadata).toBeDefined();
|
||||||
|
const buildRefs = bake.resolveRefs(metadata);
|
||||||
|
expect(buildRefs).toBeDefined();
|
||||||
|
expect(buildRefs?.length).toEqual(3);
|
||||||
|
const buildWarnings = bake.resolveWarnings(metadata);
|
||||||
|
expect(buildWarnings).toBeDefined();
|
||||||
|
|
||||||
|
const annotations = await Buildx.convertWarningsToGitHubAnnotations(buildWarnings ?? [], buildRefs ?? []);
|
||||||
|
expect(annotations).toBeDefined();
|
||||||
|
expect(annotations?.length).toBeGreaterThan(0);
|
||||||
|
|
||||||
|
for (const annotation of annotations ?? []) {
|
||||||
|
core.warning(annotation.message, annotation);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -15,8 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {describe, expect, it, jest, test, beforeEach, afterEach} from '@jest/globals';
|
import {describe, expect, it, jest, test, beforeEach, afterEach} from '@jest/globals';
|
||||||
import * as fs from 'fs';
|
import fs from 'fs';
|
||||||
import * as path from 'path';
|
import os from 'os';
|
||||||
|
import path from 'path';
|
||||||
import * as rimraf from 'rimraf';
|
import * as rimraf from 'rimraf';
|
||||||
import * as semver from 'semver';
|
import * as semver from 'semver';
|
||||||
|
|
||||||
@@ -26,15 +27,12 @@ import {Exec} from '../../src/exec';
|
|||||||
|
|
||||||
import {Cert, LocalState} from '../../src/types/buildx/buildx';
|
import {Cert, LocalState} from '../../src/types/buildx/buildx';
|
||||||
|
|
||||||
const fixturesDir = path.join(__dirname, '..', 'fixtures');
|
const fixturesDir = path.join(__dirname, '..', '.fixtures');
|
||||||
// prettier-ignore
|
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'buildx-buildx-'));
|
||||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'buildx-jest');
|
|
||||||
const tmpName = path.join(tmpDir, '.tmpname-jest');
|
const tmpName = path.join(tmpDir, '.tmpname-jest');
|
||||||
|
|
||||||
jest.spyOn(Context, 'tmpDir').mockImplementation((): string => {
|
jest.spyOn(Context, 'tmpDir').mockImplementation((): string => {
|
||||||
if (!fs.existsSync(tmpDir)) {
|
fs.mkdirSync(tmpDir, {recursive: true});
|
||||||
fs.mkdirSync(tmpDir, {recursive: true});
|
|
||||||
}
|
|
||||||
return tmpDir;
|
return tmpDir;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {afterEach, beforeEach, describe, expect, it, jest, test} from '@jest/globals';
|
import {afterEach, beforeEach, describe, expect, it, jest, test} from '@jest/globals';
|
||||||
import * as fs from 'fs';
|
import fs from 'fs';
|
||||||
import * as path from 'path';
|
import os from 'os';
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
import {Buildx} from '../../src/buildx/buildx';
|
import {Buildx} from '../../src/buildx/buildx';
|
||||||
import {Bake} from '../../src/buildx/bake';
|
import {Bake} from '../../src/buildx/bake';
|
||||||
@@ -24,10 +25,8 @@ import {Build} from '../../src/buildx/build';
|
|||||||
import {History} from '../../src/buildx/history';
|
import {History} from '../../src/buildx/history';
|
||||||
import {Exec} from '../../src/exec';
|
import {Exec} from '../../src/exec';
|
||||||
|
|
||||||
const fixturesDir = path.join(__dirname, '..', 'fixtures');
|
const fixturesDir = path.join(__dirname, '..', '.fixtures');
|
||||||
|
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'buildx-history-itg-'));
|
||||||
// prettier-ignore
|
|
||||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'buildx-history-jest');
|
|
||||||
|
|
||||||
const maybe = !process.env.GITHUB_ACTIONS || (process.env.GITHUB_ACTIONS === 'true' && process.env.ImageOS && process.env.ImageOS.startsWith('ubuntu')) ? describe : describe.skip;
|
const maybe = !process.env.GITHUB_ACTIONS || (process.env.GITHUB_ACTIONS === 'true' && process.env.ImageOS && process.env.ImageOS.startsWith('ubuntu')) ? describe : describe.skip;
|
||||||
|
|
||||||
|
|||||||
@@ -15,15 +15,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {describe, expect, it, jest, test, afterEach} from '@jest/globals';
|
import {describe, expect, it, jest, test, afterEach} from '@jest/globals';
|
||||||
import * as fs from 'fs';
|
import fs from 'fs';
|
||||||
import * as path from 'path';
|
import os from 'os';
|
||||||
|
import path from 'path';
|
||||||
import * as rimraf from 'rimraf';
|
import * as rimraf from 'rimraf';
|
||||||
import osm = require('os');
|
import osm = require('os');
|
||||||
|
|
||||||
import {Install} from '../../src/buildx/install';
|
import {Install} from '../../src/buildx/install';
|
||||||
|
|
||||||
// prettier-ignore
|
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'buildx-install-'));
|
||||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'buildx-jest');
|
|
||||||
|
|
||||||
afterEach(function () {
|
afterEach(function () {
|
||||||
rimraf.sync(tmpDir);
|
rimraf.sync(tmpDir);
|
||||||
|
|||||||
@@ -14,15 +14,15 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import path from 'path';
|
|
||||||
import {describe, expect, it} from '@jest/globals';
|
import {describe, expect, it} from '@jest/globals';
|
||||||
|
import fs from 'fs';
|
||||||
|
import os from 'os';
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
import {Cache} from '../src/cache';
|
import {Cache} from '../src/cache';
|
||||||
|
|
||||||
// prettier-ignore
|
const fixturesDir = path.join(__dirname, '.fixtures');
|
||||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'cache-jest');
|
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'cache-itg-'));
|
||||||
|
|
||||||
const fixturesDir = path.join(__dirname, 'fixtures');
|
|
||||||
|
|
||||||
describe('cache', () => {
|
describe('cache', () => {
|
||||||
it('github-repo', async () => {
|
it('github-repo', async () => {
|
||||||
|
|||||||
@@ -14,21 +14,19 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as fs from 'fs';
|
|
||||||
import * as path from 'path';
|
|
||||||
import * as rimraf from 'rimraf';
|
|
||||||
import {describe, expect, jest, it, afterEach} from '@jest/globals';
|
import {describe, expect, jest, it, afterEach} from '@jest/globals';
|
||||||
|
import fs from 'fs';
|
||||||
|
import os from 'os';
|
||||||
|
import path from 'path';
|
||||||
|
import * as rimraf from 'rimraf';
|
||||||
|
|
||||||
import {Context} from '../src/context';
|
import {Context} from '../src/context';
|
||||||
|
|
||||||
// prettier-ignore
|
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'context-'));
|
||||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'context-jest');
|
|
||||||
const tmpName = path.join(tmpDir, '.tmpname-jest');
|
const tmpName = path.join(tmpDir, '.tmpname-jest');
|
||||||
|
|
||||||
jest.spyOn(Context, 'tmpDir').mockImplementation((): string => {
|
jest.spyOn(Context, 'tmpDir').mockImplementation((): string => {
|
||||||
if (!fs.existsSync(tmpDir)) {
|
fs.mkdirSync(tmpDir, {recursive: true});
|
||||||
fs.mkdirSync(tmpDir, {recursive: true});
|
|
||||||
}
|
|
||||||
return tmpDir;
|
return tmpDir;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {afterEach, beforeEach, describe, expect, it, jest} from '@jest/globals';
|
import {afterEach, beforeEach, describe, expect, it, jest} from '@jest/globals';
|
||||||
import * as fs from 'fs';
|
import fs from 'fs';
|
||||||
|
import os from 'os';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import * as io from '@actions/io';
|
import * as io from '@actions/io';
|
||||||
import osm = require('os');
|
import osm = require('os');
|
||||||
@@ -25,10 +26,8 @@ import {Docker} from '../../src/docker/docker';
|
|||||||
|
|
||||||
import {ConfigFile} from '../../src/types/docker/docker';
|
import {ConfigFile} from '../../src/types/docker/docker';
|
||||||
|
|
||||||
const fixturesDir = path.join(__dirname, '..', 'fixtures');
|
const fixturesDir = path.join(__dirname, '..', '.fixtures');
|
||||||
|
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'docker-docker-'));
|
||||||
// prettier-ignore
|
|
||||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'docker-jest');
|
|
||||||
|
|
||||||
afterEach(function () {
|
afterEach(function () {
|
||||||
rimraf.sync(tmpDir);
|
rimraf.sync(tmpDir);
|
||||||
|
|||||||
@@ -14,15 +14,16 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import path from 'path';
|
|
||||||
import {jest, describe, expect, test, beforeEach, afterEach} from '@jest/globals';
|
import {jest, describe, expect, test, beforeEach, afterEach} from '@jest/globals';
|
||||||
|
import fs from 'fs';
|
||||||
|
import os from 'os';
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
import {Install} from '../../src/docker/install';
|
import {Install} from '../../src/docker/install';
|
||||||
import {Docker} from '../../src/docker/docker';
|
import {Docker} from '../../src/docker/docker';
|
||||||
import {Exec} from '../../src/exec';
|
import {Exec} from '../../src/exec';
|
||||||
|
|
||||||
// prettier-ignore
|
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'docker-install-itg-'));
|
||||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'docker-install-jest');
|
|
||||||
|
|
||||||
describe('install', () => {
|
describe('install', () => {
|
||||||
const originalEnv = process.env;
|
const originalEnv = process.env;
|
||||||
|
|||||||
@@ -15,15 +15,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {describe, expect, jest, test, beforeEach, afterEach, it} from '@jest/globals';
|
import {describe, expect, jest, test, beforeEach, afterEach, it} from '@jest/globals';
|
||||||
import * as fs from 'fs';
|
import fs from 'fs';
|
||||||
import * as path from 'path';
|
import os from 'os';
|
||||||
|
import path from 'path';
|
||||||
import * as rimraf from 'rimraf';
|
import * as rimraf from 'rimraf';
|
||||||
import osm = require('os');
|
import osm = require('os');
|
||||||
|
|
||||||
import {Install} from '../../src/docker/install';
|
import {Install} from '../../src/docker/install';
|
||||||
|
|
||||||
// prettier-ignore
|
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'docker-install-'));
|
||||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'docker-install-jest');
|
|
||||||
|
|
||||||
afterEach(function () {
|
afterEach(function () {
|
||||||
rimraf.sync(tmpDir);
|
rimraf.sync(tmpDir);
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ import * as path from 'path';
|
|||||||
import {DockerHub} from '../src/dockerhub';
|
import {DockerHub} from '../src/dockerhub';
|
||||||
import {RepositoryResponse, RepositoryTagsResponse} from '../src/types/dockerhub';
|
import {RepositoryResponse, RepositoryTagsResponse} from '../src/types/dockerhub';
|
||||||
|
|
||||||
import repoInfoFixture from './fixtures/dockerhub-repoinfo.json';
|
import repoInfoFixture from './.fixtures/dockerhub-repoinfo.json';
|
||||||
import repoTagsFixture from './fixtures/dockerhub-repotags.json';
|
import repoTagsFixture from './.fixtures/dockerhub-repotags.json';
|
||||||
import repoAllTagsFixture from './fixtures/dockerhub-repoalltags.json';
|
import repoAllTagsFixture from './.fixtures/dockerhub-repoalltags.json';
|
||||||
|
|
||||||
describe('getRepository', () => {
|
describe('getRepository', () => {
|
||||||
it('returns repo info', async () => {
|
it('returns repo info', async () => {
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
|
|
||||||
import {describe, expect, it, test} from '@jest/globals';
|
import {describe, expect, it, test} from '@jest/globals';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import * as path from 'path';
|
import os from 'os';
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
import {Buildx} from '../src/buildx/buildx';
|
import {Buildx} from '../src/buildx/buildx';
|
||||||
import {Bake} from '../src/buildx/bake';
|
import {Bake} from '../src/buildx/bake';
|
||||||
@@ -25,10 +26,8 @@ import {Exec} from '../src/exec';
|
|||||||
import {GitHub} from '../src/github';
|
import {GitHub} from '../src/github';
|
||||||
import {History} from '../src/buildx/history';
|
import {History} from '../src/buildx/history';
|
||||||
|
|
||||||
const fixturesDir = path.join(__dirname, 'fixtures');
|
const fixturesDir = path.join(__dirname, '.fixtures');
|
||||||
|
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'github-itg-'));
|
||||||
// prettier-ignore
|
|
||||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'github-jest');
|
|
||||||
|
|
||||||
const maybe = !process.env.GITHUB_ACTIONS || (process.env.GITHUB_ACTIONS === 'true' && process.env.ImageOS && process.env.ImageOS.startsWith('ubuntu')) ? describe : describe.skip;
|
const maybe = !process.env.GITHUB_ACTIONS || (process.env.GITHUB_ACTIONS === 'true' && process.env.ImageOS && process.env.ImageOS.startsWith('ubuntu')) ? describe : describe.skip;
|
||||||
|
|
||||||
@@ -295,40 +294,3 @@ maybe('writeBuildSummary', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
maybe('annotateBuildWarnings', () => {
|
|
||||||
it('annoate lint issues', async () => {
|
|
||||||
const buildx = new Buildx();
|
|
||||||
const build = new Build({buildx: buildx});
|
|
||||||
|
|
||||||
fs.mkdirSync(tmpDir, {recursive: true});
|
|
||||||
await expect(
|
|
||||||
(async () => {
|
|
||||||
// prettier-ignore
|
|
||||||
const buildCmd = await buildx.getCommand([
|
|
||||||
'--builder', process.env.CTN_BUILDER_NAME ?? 'default',
|
|
||||||
'build',
|
|
||||||
'-f', path.join(fixturesDir, 'lint.Dockerfile'),
|
|
||||||
fixturesDir,
|
|
||||||
'--metadata-file', build.getMetadataFilePath()
|
|
||||||
]);
|
|
||||||
await Exec.exec(buildCmd.command, buildCmd.args, {
|
|
||||||
env: Object.assign({}, process.env, {
|
|
||||||
BUILDX_METADATA_WARNINGS: 'true'
|
|
||||||
}) as {
|
|
||||||
[key: string]: string;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})()
|
|
||||||
).resolves.not.toThrow();
|
|
||||||
|
|
||||||
const metadata = build.resolveMetadata();
|
|
||||||
expect(metadata).toBeDefined();
|
|
||||||
const buildRef = build.resolveRef(metadata);
|
|
||||||
expect(buildRef).toBeDefined();
|
|
||||||
const buildWarnings = build.resolveWarnings(metadata);
|
|
||||||
expect(buildWarnings).toBeDefined();
|
|
||||||
|
|
||||||
await GitHub.annotateBuildWarnings(path.join(fixturesDir, 'lint.Dockerfile'), buildWarnings);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import * as core from '@actions/core';
|
|||||||
import {GitHub} from '../src/github';
|
import {GitHub} from '../src/github';
|
||||||
import {GitHubRepo} from '../src/types/github';
|
import {GitHubRepo} from '../src/types/github';
|
||||||
|
|
||||||
import repoFixture from './fixtures/github-repo.json';
|
import repoFixture from './.fixtures/github-repo.json';
|
||||||
jest.spyOn(GitHub.prototype, 'repoData').mockImplementation((): Promise<GitHubRepo> => {
|
jest.spyOn(GitHub.prototype, 'repoData').mockImplementation((): Promise<GitHubRepo> => {
|
||||||
return <Promise<GitHubRepo>>(repoFixture as unknown);
|
return <Promise<GitHubRepo>>(repoFixture as unknown);
|
||||||
});
|
});
|
||||||
@@ -123,7 +123,7 @@ describe('actionsRuntimeToken', () => {
|
|||||||
});
|
});
|
||||||
it('fixture', async () => {
|
it('fixture', async () => {
|
||||||
process.env.ACTIONS_RUNTIME_TOKEN = fs
|
process.env.ACTIONS_RUNTIME_TOKEN = fs
|
||||||
.readFileSync(path.join(__dirname, 'fixtures', 'runtimeToken.txt'))
|
.readFileSync(path.join(__dirname, '.fixtures', 'runtimeToken.txt'))
|
||||||
.toString()
|
.toString()
|
||||||
.trim();
|
.trim();
|
||||||
const runtimeToken = GitHub.actionsRuntimeToken;
|
const runtimeToken = GitHub.actionsRuntimeToken;
|
||||||
@@ -154,7 +154,7 @@ describe('printActionsRuntimeTokenACs', () => {
|
|||||||
it('refs/heads/master', async () => {
|
it('refs/heads/master', async () => {
|
||||||
const infoSpy = jest.spyOn(core, 'info');
|
const infoSpy = jest.spyOn(core, 'info');
|
||||||
process.env.ACTIONS_RUNTIME_TOKEN = fs
|
process.env.ACTIONS_RUNTIME_TOKEN = fs
|
||||||
.readFileSync(path.join(__dirname, 'fixtures', 'runtimeToken.txt'))
|
.readFileSync(path.join(__dirname, '.fixtures', 'runtimeToken.txt'))
|
||||||
.toString()
|
.toString()
|
||||||
.trim();
|
.trim();
|
||||||
await GitHub.printActionsRuntimeTokenACs();
|
await GitHub.printActionsRuntimeTokenACs();
|
||||||
|
|||||||
@@ -15,16 +15,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {afterEach, describe, expect, test} from '@jest/globals';
|
import {afterEach, describe, expect, test} from '@jest/globals';
|
||||||
import * as fs from 'fs';
|
import fs from 'fs';
|
||||||
|
import os from 'os';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import * as rimraf from 'rimraf';
|
import * as rimraf from 'rimraf';
|
||||||
|
|
||||||
import {OCI} from '../../src/oci/oci';
|
import {OCI} from '../../src/oci/oci';
|
||||||
|
|
||||||
const fixturesDir = path.join(__dirname, '..', 'fixtures');
|
const fixturesDir = path.join(__dirname, '..', '.fixtures');
|
||||||
|
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'oci-oci-'));
|
||||||
// prettier-ignore
|
|
||||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'docker-jest');
|
|
||||||
|
|
||||||
afterEach(function () {
|
afterEach(function () {
|
||||||
rimraf.sync(tmpDir);
|
rimraf.sync(tmpDir);
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ FOO=bar`
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('large multiline values', async () => {
|
it('large multiline values', async () => {
|
||||||
const pgp = fs.readFileSync(path.join(__dirname, 'fixtures', 'pgp.txt'), {encoding: 'utf-8'});
|
const pgp = fs.readFileSync(path.join(__dirname, '.fixtures', 'pgp.txt'), {encoding: 'utf-8'});
|
||||||
setInput(
|
setInput(
|
||||||
'secrets',
|
'secrets',
|
||||||
`"GPG_KEY=${pgp}"
|
`"GPG_KEY=${pgp}"
|
||||||
@@ -416,6 +416,34 @@ lines`;
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('isPathRelativeTo', () => {
|
||||||
|
it('should return true for a child path directly inside the parent path', () => {
|
||||||
|
const parentPath = '/home/user/projects';
|
||||||
|
const childPath = '/home/user/projects/subproject';
|
||||||
|
expect(Util.isPathRelativeTo(parentPath, childPath)).toBe(true);
|
||||||
|
});
|
||||||
|
it('should return true for a deeply nested child path inside the parent path', () => {
|
||||||
|
const parentPath = '/home/user';
|
||||||
|
const childPath = '/home/user/projects/subproject/module';
|
||||||
|
expect(Util.isPathRelativeTo(parentPath, childPath)).toBe(true);
|
||||||
|
});
|
||||||
|
it('should return false for a child path outside the parent path', () => {
|
||||||
|
const parentPath = '/home/user/projects';
|
||||||
|
const childPath = '/home/user/otherprojects/subproject';
|
||||||
|
expect(Util.isPathRelativeTo(parentPath, childPath)).toBe(false);
|
||||||
|
});
|
||||||
|
it('should return true for a child path specified with relative segments', () => {
|
||||||
|
const parentPath = '/home/user/projects';
|
||||||
|
const childPath = '/home/user/projects/../projects/subproject';
|
||||||
|
expect(Util.isPathRelativeTo(parentPath, childPath)).toBe(true);
|
||||||
|
});
|
||||||
|
it('should return false when the child path is actually a parent path', () => {
|
||||||
|
const parentPath = '/home/user/projects/subproject';
|
||||||
|
const childPath = '/home/user/projects';
|
||||||
|
expect(Util.isPathRelativeTo(parentPath, childPath)).toBe(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// See: https://github.com/actions/toolkit/blob/a1b068ec31a042ff1e10a522d8fdf0b8869d53ca/packages/core/src/core.ts#L89
|
// See: https://github.com/actions/toolkit/blob/a1b068ec31a042ff1e10a522d8fdf0b8869d53ca/packages/core/src/core.ts#L89
|
||||||
function getInputName(name: string): string {
|
function getInputName(name: string): string {
|
||||||
return `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
|
return `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
ARG NODE_VERSION=20
|
ARG NODE_VERSION=20
|
||||||
ARG DOCKER_VERSION=26.0.2
|
ARG DOCKER_VERSION=26.0.2
|
||||||
ARG BUILDX_VERSION=0.16.1
|
ARG BUILDX_VERSION=0.16.2
|
||||||
|
|
||||||
FROM node:${NODE_VERSION}-alpine AS base
|
FROM node:${NODE_VERSION}-alpine AS base
|
||||||
RUN apk add --no-cache cpio findutils git
|
RUN apk add --no-cache cpio findutils git
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import {Util} from '../util';
|
|||||||
import {ExecOptions} from '@actions/exec';
|
import {ExecOptions} from '@actions/exec';
|
||||||
import {BakeDefinition} from '../types/buildx/bake';
|
import {BakeDefinition} from '../types/buildx/bake';
|
||||||
import {BuildMetadata} from '../types/buildx/build';
|
import {BuildMetadata} from '../types/buildx/build';
|
||||||
|
import {VertexWarning} from '../types/buildkit/client';
|
||||||
|
|
||||||
export interface BakeOpts {
|
export interface BakeOpts {
|
||||||
buildx?: Buildx;
|
buildx?: Buildx;
|
||||||
@@ -86,6 +87,19 @@ export class Bake {
|
|||||||
return refs.length > 0 ? refs : undefined;
|
return refs.length > 0 ? refs : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public resolveWarnings(metadata?: BuildMetadata): Array<VertexWarning> | undefined {
|
||||||
|
if (!metadata) {
|
||||||
|
metadata = this.resolveMetadata();
|
||||||
|
if (!metadata) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ('buildx.build.warnings' in metadata) {
|
||||||
|
return metadata['buildx.build.warnings'] as Array<VertexWarning>;
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
public async getDefinition(cmdOpts: BakeCmdOpts, execOptions?: ExecOptions): Promise<BakeDefinition> {
|
public async getDefinition(cmdOpts: BakeCmdOpts, execOptions?: ExecOptions): Promise<BakeDefinition> {
|
||||||
execOptions = execOptions || {ignoreReturnCode: true};
|
execOptions = execOptions || {ignoreReturnCode: true};
|
||||||
execOptions.ignoreReturnCode = true;
|
execOptions.ignoreReturnCode = true;
|
||||||
|
|||||||
@@ -19,10 +19,16 @@ import path from 'path';
|
|||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as semver from 'semver';
|
import * as semver from 'semver';
|
||||||
|
|
||||||
|
import {Git} from '../buildkit/git';
|
||||||
import {Docker} from '../docker/docker';
|
import {Docker} from '../docker/docker';
|
||||||
|
import {GitHub} from '../github';
|
||||||
import {Exec} from '../exec';
|
import {Exec} from '../exec';
|
||||||
|
import {Util} from '../util';
|
||||||
|
|
||||||
|
import {VertexWarning} from '../types/buildkit/client';
|
||||||
|
import {GitURL} from '../types/buildkit/git';
|
||||||
import {Cert, LocalRefsOpts, LocalRefsResponse, LocalState} from '../types/buildx/buildx';
|
import {Cert, LocalRefsOpts, LocalRefsResponse, LocalState} from '../types/buildx/buildx';
|
||||||
|
import {GitHubAnnotation} from '../types/github';
|
||||||
|
|
||||||
export interface BuildxOpts {
|
export interface BuildxOpts {
|
||||||
standalone?: boolean;
|
standalone?: boolean;
|
||||||
@@ -266,4 +272,151 @@ export class Buildx {
|
|||||||
|
|
||||||
return refs;
|
return refs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static async convertWarningsToGitHubAnnotations(warnings: Array<VertexWarning>, buildRefs: Array<string>, refsDir?: string): Promise<Array<GitHubAnnotation> | undefined> {
|
||||||
|
if (warnings.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const fnGitURL = function (inp: string): GitURL | undefined {
|
||||||
|
try {
|
||||||
|
return Git.parseURL(inp);
|
||||||
|
} catch (e) {
|
||||||
|
// noop
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const fnLocalState = function (ref: string): LocalState | undefined {
|
||||||
|
try {
|
||||||
|
return Buildx.localState(ref, refsDir);
|
||||||
|
} catch (e) {
|
||||||
|
core.debug(`Buildx.convertWarningsToGitHubAnnotations(${ref}): local state not found: ${e.message}`);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
interface Dockerfile {
|
||||||
|
path: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
content?: any;
|
||||||
|
remote?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const dockerfiles: Array<Dockerfile> = [];
|
||||||
|
for (const ref of buildRefs) {
|
||||||
|
const ls = fnLocalState(ref);
|
||||||
|
if (!ls) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ls.DockerfilePath == '-') {
|
||||||
|
// exclude dockerfile from stdin
|
||||||
|
core.debug(`Buildx.convertWarningsToGitHubAnnotations(${ref}): skipping stdin Dockerfile`);
|
||||||
|
continue;
|
||||||
|
} else if (ls.DockerfilePath == '') {
|
||||||
|
ls.DockerfilePath = 'Dockerfile';
|
||||||
|
}
|
||||||
|
|
||||||
|
const gitURL = fnGitURL(ls.LocalPath);
|
||||||
|
if (gitURL) {
|
||||||
|
core.debug(`Buildx.convertWarningsToGitHubAnnotations(${ref}): git context detected: ${ls.LocalPath}`);
|
||||||
|
const remoteHost = gitURL.host.replace(/:.*/, '');
|
||||||
|
if (remoteHost !== 'github.com' && !remoteHost.endsWith('.ghe.com')) {
|
||||||
|
// we only support running actions on GitHub for now
|
||||||
|
// we might add support for GitLab in the future
|
||||||
|
core.debug(`Buildx.convertWarningsToGitHubAnnotations(${ref}): not a GitHub repo: ${remoteHost}`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// if repository matches then we can link to the Dockerfile
|
||||||
|
const remoteRepo = gitURL.path.replace(/^\//, '').replace(/\.git$/, '');
|
||||||
|
if (remoteRepo !== GitHub.repository) {
|
||||||
|
core.debug(`Buildx.convertWarningsToGitHubAnnotations(${ref}): not same GitHub repo: ${remoteRepo} != ${GitHub.repository}`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
dockerfiles.push({
|
||||||
|
path: ls.DockerfilePath, // dockerfile path is always relative for a git context
|
||||||
|
remote: true
|
||||||
|
});
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fs.existsSync(ls.DockerfilePath)) {
|
||||||
|
core.debug(`Buildx.convertWarningsToGitHubAnnotations: Dockerfile not found from localstate ref ${ref}: ${ls.DockerfilePath}`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const workspaceDir = GitHub.workspace;
|
||||||
|
// only treat dockerfile path relative to GitHub actions workspace dir
|
||||||
|
if (Util.isPathRelativeTo(workspaceDir, ls.DockerfilePath)) {
|
||||||
|
dockerfiles.push({
|
||||||
|
path: path.relative(workspaceDir, ls.DockerfilePath),
|
||||||
|
content: btoa(fs.readFileSync(ls.DockerfilePath, {encoding: 'utf-8'}))
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
core.debug(`Buildx.convertWarningsToGitHubAnnotations: skipping Dockerfile outside of workspace: ${ls.DockerfilePath}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dockerfiles.length === 0) {
|
||||||
|
core.debug(`Buildx.convertWarningsToGitHubAnnotations: no Dockerfiles found`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
core.debug(`Buildx.convertWarningsToGitHubAnnotations: found ${dockerfiles.length} Dockerfiles: ${JSON.stringify(dockerfiles, null, 2)}`);
|
||||||
|
|
||||||
|
const annotations: Array<GitHubAnnotation> = [];
|
||||||
|
for (const warning of warnings) {
|
||||||
|
if (!warning.detail || !warning.short) {
|
||||||
|
core.debug(`Buildx.convertWarningsToGitHubAnnotations: skipping warning without detail or short`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const warningSourceFilename = warning.sourceInfo?.filename;
|
||||||
|
const warningSourceData = warning.sourceInfo?.data;
|
||||||
|
if (!warningSourceFilename || !warningSourceData) {
|
||||||
|
core.debug(`Buildx.convertWarningsToGitHubAnnotations: skipping warning without source info filename or data`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const title = warning.detail.map(encoded => atob(encoded)).join(' ');
|
||||||
|
let message = atob(warning.short).replace(/\s\(line \d+\)$/, '');
|
||||||
|
if (warning.url) {
|
||||||
|
// https://github.com/docker/buildx/blob/d8c9ebde1fdcf659f1fa3efa6ccc27a28b0f1564/commands/build.go#L854
|
||||||
|
message += `\nMore info: ${warning.url}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// GitHub's annotations don't clearly show ranges of lines, so we'll just
|
||||||
|
// show the first line: https://github.com/orgs/community/discussions/129899
|
||||||
|
const startLine = warning.range && warning.range.length > 0 ? warning.range[0]?.start.line : undefined;
|
||||||
|
|
||||||
|
// TODO: When GitHub's annotations support showing ranges properly, we can use this code
|
||||||
|
// let startLine: number | undefined, endLine: number | undefined;
|
||||||
|
// for (const range of warning.range ?? []) {
|
||||||
|
// if (range.start.line && (!startLine || range.start.line < startLine)) {
|
||||||
|
// startLine = range.start.line;
|
||||||
|
// }
|
||||||
|
// if (range.end.line && (!endLine || range.end.line > endLine)) {
|
||||||
|
// endLine = range.end.line;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
let annotated = false;
|
||||||
|
for (const dockerfile of dockerfiles) {
|
||||||
|
// a valid dockerfile path and content is required to match the warning
|
||||||
|
// source info or always assume it's valid if this is a remote git
|
||||||
|
// context as we can't read the content of the Dockerfile in this case.
|
||||||
|
if (dockerfile.remote || (dockerfile.path.endsWith(warningSourceFilename) && dockerfile.content === warningSourceData)) {
|
||||||
|
annotations.push({
|
||||||
|
title: title,
|
||||||
|
message: message,
|
||||||
|
file: dockerfile.path,
|
||||||
|
startLine: startLine
|
||||||
|
});
|
||||||
|
annotated = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!annotated) {
|
||||||
|
core.debug(`Buildx.convertWarningsToGitHubAnnotations: skipping warning without matching Dockerfile ${warningSourceFilename}: ${title}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return annotations;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export class History {
|
|||||||
throw new Error('Docker is required to export a build record');
|
throw new Error('Docker is required to export a build record');
|
||||||
}
|
}
|
||||||
if (!(await Docker.isDaemonRunning())) {
|
if (!(await Docker.isDaemonRunning())) {
|
||||||
throw new Error('Docker daemon is not running, skipping build record export');
|
throw new Error('Docker daemon needs to be running to export a build record');
|
||||||
}
|
}
|
||||||
if (!(await this.buildx.versionSatisfies('>=0.13.0'))) {
|
if (!(await this.buildx.versionSatisfies('>=0.13.0'))) {
|
||||||
throw new Error('Buildx >= 0.13.0 is required to export a build record');
|
throw new Error('Buildx >= 0.13.0 is required to export a build record');
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ import {jwtDecode, JwtPayload} from 'jwt-decode';
|
|||||||
|
|
||||||
import {Util} from './util';
|
import {Util} from './util';
|
||||||
|
|
||||||
import {VertexWarning} from './types/buildkit/client';
|
|
||||||
import {BuildSummaryOpts, GitHubActionsRuntimeToken, GitHubActionsRuntimeTokenAC, GitHubRepo, UploadArtifactOpts, UploadArtifactResponse} from './types/github';
|
import {BuildSummaryOpts, GitHubActionsRuntimeToken, GitHubActionsRuntimeTokenAC, GitHubRepo, UploadArtifactOpts, UploadArtifactResponse} from './types/github';
|
||||||
|
|
||||||
export interface GitHubOpts {
|
export interface GitHubOpts {
|
||||||
@@ -77,6 +76,10 @@ export class GitHub {
|
|||||||
return `${github.context.repo.owner}/${github.context.repo.repo}`;
|
return `${github.context.repo.owner}/${github.context.repo.repo}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static get workspace(): string {
|
||||||
|
return process.env.GITHUB_WORKSPACE || process.cwd();
|
||||||
|
}
|
||||||
|
|
||||||
static get runId(): number {
|
static get runId(): number {
|
||||||
return process.env.GITHUB_RUN_ID ? +process.env.GITHUB_RUN_ID : github.context.runId;
|
return process.env.GITHUB_RUN_ID ? +process.env.GITHUB_RUN_ID : github.context.runId;
|
||||||
}
|
}
|
||||||
@@ -342,39 +345,4 @@ export class GitHub {
|
|||||||
core.info(`Writing summary`);
|
core.info(`Writing summary`);
|
||||||
await sum.addSeparator().write();
|
await sum.addSeparator().write();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async annotateBuildWarnings(source: string, warnings?: Array<VertexWarning>): Promise<void> {
|
|
||||||
(warnings ?? []).forEach(warning => {
|
|
||||||
if (!warning.detail || !warning.short) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const title = warning.detail.map(encoded => atob(encoded)).join(' ');
|
|
||||||
let message = atob(warning.short).replace(/\s\(line \d+\)$/, '');
|
|
||||||
if (warning.url) {
|
|
||||||
// https://github.com/docker/buildx/blob/d8c9ebde1fdcf659f1fa3efa6ccc27a28b0f1564/commands/build.go#L854
|
|
||||||
message += `\nMore info: ${warning.url}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
// GitHub annotations don't clearly show ranges of lines, so we'll just
|
|
||||||
// show the first line
|
|
||||||
const startLine = warning.range && warning.range.length > 0 ? warning.range[0]?.start.line : undefined;
|
|
||||||
|
|
||||||
// TODO: When GitHub annotations support showing ranges properly, we can use this code
|
|
||||||
// let startLine: number | undefined, endLine: number | undefined;
|
|
||||||
// for (const range of warning.range ?? []) {
|
|
||||||
// if (range.start.line && (!startLine || range.start.line < startLine)) {
|
|
||||||
// startLine = range.start.line;
|
|
||||||
// }
|
|
||||||
// if (range.end.line && (!endLine || range.end.line > endLine)) {
|
|
||||||
// endLine = range.end.line;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
core.warning(message, {
|
|
||||||
title: title,
|
|
||||||
file: source,
|
|
||||||
startLine: startLine
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import {AnnotationProperties} from '@actions/core';
|
||||||
import {components as OctoOpenApiTypes} from '@octokit/openapi-types';
|
import {components as OctoOpenApiTypes} from '@octokit/openapi-types';
|
||||||
import {JwtPayload} from 'jwt-decode';
|
import {JwtPayload} from 'jwt-decode';
|
||||||
|
|
||||||
@@ -38,6 +39,10 @@ export interface GitHubActionsRuntimeTokenAC {
|
|||||||
Permission: number;
|
Permission: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface GitHubAnnotation extends AnnotationProperties {
|
||||||
|
message: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface UploadArtifactOpts {
|
export interface UploadArtifactOpts {
|
||||||
filename: string;
|
filename: string;
|
||||||
mimeType?: string;
|
mimeType?: string;
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
import crypto from 'crypto';
|
import crypto from 'crypto';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
import path from 'path';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as io from '@actions/io';
|
import * as io from '@actions/io';
|
||||||
import {parse} from 'csv-parse/sync';
|
import {parse} from 'csv-parse/sync';
|
||||||
@@ -189,4 +190,10 @@ export class Util {
|
|||||||
public static countLines(input: string): number {
|
public static countLines(input: string): number {
|
||||||
return input.split(/\r\n|\r|\n/).length;
|
return input.split(/\r\n|\r|\n/).length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static isPathRelativeTo(parentPath: string, childPath: string): boolean {
|
||||||
|
const rpp = path.resolve(parentPath);
|
||||||
|
const rcp = path.resolve(childPath);
|
||||||
|
return rcp.startsWith(rpp.endsWith(path.sep) ? rpp : `${rpp}${path.sep}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user