Skip to content

Commit 7423518

Browse files
committed
feat: use boil to determine product versions
1 parent ef12893 commit 7423518

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

.github/workflows/scan.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ jobs:
1616
- uses: actions/setup-python@v5
1717
with:
1818
python-version: 3.11
19+
- name: Setup Rust
20+
uses: actions-rust-lang/setup-rust-toolchain@v1
21+
with:
22+
toolchain: stable
1923
- name: Run image
2024
uses: abatilo/actions-poetry@v2
2125
with:

.github/workflows/scan_release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ jobs:
1919
- uses: actions/setup-python@v5
2020
with:
2121
python-version: 3.11
22+
- name: Setup Rust
23+
uses: actions-rust-lang/setup-rust-toolchain@v1
24+
with:
25+
toolchain: stable
2226
- name: Run image
2327
uses: abatilo/actions-poetry@v2
2428
with:

stack_scanner/main.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from urllib.request import urlretrieve
2-
from image_tools.args import load_configuration
31
import tempfile
42
import os
53
import subprocess
@@ -90,17 +88,22 @@ def main():
9088
f"{release}-{arch}",
9189
)
9290

93-
# Load product versions from that file using the image-tools functionality
94-
sys.path.append("docker-images")
95-
product_versions = load_configuration("docker-images/conf.py")
96-
97-
for product in product_versions.products:
98-
product_name: str = product["name"]
99-
91+
# Load product versions using boil
92+
result = subprocess.run(
93+
["cargo", "boil", "show", "images"],
94+
cwd="docker-images",
95+
capture_output=True,
96+
text=True,
97+
)
98+
if result.returncode != 0:
99+
print("Failed to get product versions:", result.stderr)
100+
sys.exit(1)
101+
product_versions = json.loads(result.stdout)
102+
103+
for product_name, versions in product_versions.items():
100104
if product_name in excluded_products:
101105
continue
102-
for version_dict in product.get("versions", []):
103-
version: str = version_dict["product"]
106+
for version in versions:
104107
product_version = f"{version}-stackable{release}"
105108
scan_image(
106109
secobserve_api_token,

0 commit comments

Comments
 (0)