Skip to content

Commit 4963c11

Browse files
committed
add new mandatory project_folder build arg to "dev build"
1 parent 977a566 commit 4963c11

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

src/epics_containers_cli/dev/dev_cli.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,11 @@ def wait_pv(
201201
def build(
202202
ctx: typer.Context,
203203
generic_ioc: Path = typer.Option(
204-
Path("."), help="Generic IOC project folder", exists=True, file_okay=False
204+
Path("."),
205+
help="Generic IOC project folder",
206+
exists=True,
207+
file_okay=False,
208+
resolve_path=True,
205209
),
206210
tag: str = typer.Option(IMAGE_TAG, help="version tag for the image"),
207211
arch: Architecture = typer.Option(

src/epics_containers_cli/dev/dev_commands.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ def build(
204204
repo, _ = get_git_name(generic_ioc)
205205
args = f"--platform {platform} {'--no-cache' if not cache else ''}"
206206
tag = normalize_tag(tag)
207+
args += f" --build-arg PROJECT_NAME={generic_ioc.name}"
207208

208209
if target is None:
209210
targets = [Targets.developer.value, Targets.runtime.value]

tests/data/dev.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ wait_pv:
9191
rsp: "BL45P-EA-IOC-01:UPTIME 00:00:07"
9292

9393
build:
94-
- cmd: podman build --target developer --build-arg TARGET_ARCHITECTURE=linux --platform linux/amd64 -t ghcr.io/epics-containers/bl45p-linux-developer:local .
94+
- cmd: podman build --target developer --build-arg TARGET_ARCHITECTURE=linux --platform linux/amd64 --build-arg PROJECT_NAME=ioc-template -t ghcr.io/epics-containers/bl45p-linux-developer:local .
9595
rsp: True
96-
- cmd: podman build --target runtime --build-arg TARGET_ARCHITECTURE=linux --platform linux/amd64 -t ghcr.io/epics-containers/bl45p-linux-runtime:local .
96+
- cmd: podman build --target runtime --build-arg TARGET_ARCHITECTURE=linux --platform linux/amd64 --build-arg PROJECT_NAME=ioc-template -t ghcr.io/epics-containers/bl45p-linux-runtime:local .
9797
rsp: True

tests/data/ioc-template/readme.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
This folder used as a pretend generic ioc source folder folder
2+
testing
3+
4+
ec dev build

tests/test_dev.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ def test_wait_pv(mock_run, dev, data):
6565

6666
def test_build(mock_run, dev, data):
6767
mock_run.set_seq(dev.checks + dev.get_git_name + dev.build)
68-
mock_run.run_cli("dev build")
68+
mock_run.run_cli(f"dev build --generic-ioc {data / 'ioc-template'}")

0 commit comments

Comments
 (0)