Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion posit-bakery/posit_bakery/cli/ci.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import glob
import json
import logging
import re
import python_on_whales
from enum import Enum
from pathlib import Path
Expand Down Expand Up @@ -132,7 +133,7 @@ def matrix(
dev_spec=dev_spec, # type: ignore[arg-type] # typer requires str annotation; parse_dev_spec callback delivers DevBuildSpec at runtime
)
c = BakeryConfig.from_context(context=context, settings=settings)
images = [i for i in c.model.images]
images = [i for i in c.model.images if image_name is None or re.search(image_name, i.name) is not None]

data = []
for img in images:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"image": "test-alpha", "version": "1.0.0", "dev": false, "platform": "linux/amd64"}]
9 changes: 9 additions & 0 deletions posit-bakery/test/features/cli/ci/matrix.feature
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,12 @@ Feature: matrix
| --image-version | 9.9.9 |
When I execute the command
Then The command fails

Scenario: Filtering the CI matrix by image name excludes non-matching images
Given I call bakery ci matrix
* in the merge-multi-image context
* with the arguments:
| test-alpha$ |
When I execute the command
Then The command succeeds
* the matrix matches testdata ci/matrix/merge-multi-image/image_name_filter.json
Loading