Skip to content

Commit

Permalink
Move arch check from SBOM generation to this script
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentGoderre committed Sep 4, 2024
1 parent 6d4b24b commit 90104a3
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions doi.jq
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,19 @@ def _sbom_subset:
# input: "build" object (with "buildId" top level key)
# output: boolean
def build_should_sbom:
.source.arches[.build.arch].tags
| map(split(":")[0])
| unique
| _sbom_subset as $subset
| any(.[];
. as $i
| $subset
| index($i)
# see "bashbrew remote arches docker/scout-sbom-indexer:1" (we need the SBOM scanner to be runnable on the host architecture)
# bashbrew remote arches --json docker/scout-sbom-indexer:1 | jq '.arches | keys_unsorted' -c
.build.arch as $arch | ["amd64","arm32v5","arm32v7","arm64v8","i386","ppc64le","riscv64","s390x"] | index($arch)
and (
.source.arches[.build.arch].tags
| map(split(":")[0])
| unique
| _sbom_subset as $subset
| any(.[];
. as $i
| $subset
| index($i)
)
)
;

Expand Down

0 comments on commit 90104a3

Please sign in to comment.