Skip to content

Commit 376ec12

Browse files
committed
Retrieve SBOM from image manifest and fall back to syft if it fails.
Move hardcoded values to enum classes Add tests for new sbom methods
1 parent e5cc1e2 commit 376ec12

6 files changed

Lines changed: 5890 additions & 126 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ RUN \
2323
apt-get update && \
2424
apt-get install -y --no-install-recommends \
2525
docker-ce \
26+
docker-buildx-plugin \
2627
google-chrome-stable \
2728
python3-venv \
2829
unzip \

ci/ci.py

Lines changed: 194 additions & 108 deletions
Large diffs are not rendered by default.

test_build.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
#!/usr/bin/env python3
22
import os
3-
import time
43
from logging import Logger
5-
from ci.ci import CI, CIError
4+
from ci.ci import CI, CIError, Platform, CIReportResult
65
from ci.logger import configure_logging
76

87
def run_test() -> None:
98
"""Run tests on container tags then build and upload reports"""
109
ci.run(ci.tags)
1110
# Don't set the whole report as failed if any of the ARM tag fails.
1211
for tag in ci.report_containers.keys():
13-
if tag.startswith("amd64") and ci.report_containers[tag]['test_success'] == True:
14-
ci.report_status = 'PASS' # Override the report_status if an ARM tag failed, but the amd64 tag passed.
15-
if ci.report_status == 'PASS':
12+
if tag.startswith(Platform.AMD64.value) and ci.report_containers[tag]['test_success'] == True:
13+
ci.report_status = CIReportResult.PASS # Override the report_status if an ARM tag failed, but the amd64 tag passed.
14+
if ci.report_status == CIReportResult.PASS:
1615
logger.success('All tests PASSED after %.2f seconds', ci.total_runtime)
1716
ci.report_render()
1817
ci.badge_render()
1918
ci.json_render()
2019
ci.report_upload()
21-
if ci.report_status == 'PASS': # Exit based on test results
20+
if ci.report_status == CIReportResult.PASS: # Exit based on test results
2221
ci.log_upload()
2322
return
2423
logger.error('Tests FAILED')

0 commit comments

Comments
 (0)