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
10 changes: 9 additions & 1 deletion posit-bakery/posit_bakery/image/bake/bake.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import os
from pathlib import Path
from typing import Annotated, Any
Expand All @@ -7,6 +8,7 @@

from posit_bakery.config.image.build_os import TargetPlatform, DEFAULT_PLATFORMS
from posit_bakery.image.image_target import ImageTarget
from posit_bakery.settings import SETTINGS


class BakeGroup(BaseModel):
Expand Down Expand Up @@ -281,7 +283,13 @@ def build(
_set = self._set_opts_dict_to_str(_set)

python_on_whales.docker.buildx.bake(
files=[self.bake_file.name], load=load, push=push, pull=pull, cache=cache, set=_set
files=[self.bake_file.name],
load=load,
push=push,
pull=pull,
cache=cache,
set=_set,
progress=False if SETTINGS.log_level >= logging.ERROR else "auto",
)
if clean_bakefile:
self.remove()
Expand Down
1 change: 1 addition & 0 deletions posit-bakery/posit_bakery/image/image_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ def build(
platforms=platforms or self.image_os.platforms,
target=self.build_target,
secrets=[s.as_cli_option() for s in self.resolved_build_secrets],
progress=False if SETTINGS.log_level >= logging.ERROR else "auto",
)
except python_on_whales.exceptions.DockerException as e:
raise BakeryToolRuntimeError(
Expand Down
1 change: 1 addition & 0 deletions posit-bakery/test/image/bake/test_bake.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ def test_build_args(
"pull": False,
"cache": True,
"set": {},
"progress": "auto",
}

with patch("python_on_whales.docker.buildx.bake") as mock_bake:
Expand Down
9 changes: 9 additions & 0 deletions posit-bakery/test/image/test_image_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@ def test_build_args(self, basic_standard_image_target):
"platforms": ["linux/amd64"],
"target": None,
"secrets": [],
"progress": "auto",
}

with patch("python_on_whales.docker.build") as mock_build:
Expand Down Expand Up @@ -670,6 +671,7 @@ def test_build_args_with_build_args(self, basic_standard_image_target):
"platforms": ["linux/amd64"],
"target": None,
"secrets": [],
"progress": "auto",
}

with patch("python_on_whales.docker.build") as mock_build:
Expand Down Expand Up @@ -699,6 +701,7 @@ def test_build_args_cache_registry(self, basic_standard_image_target):
"platforms": ["linux/amd64"],
"target": None,
"secrets": [],
"progress": "auto",
}

with patch("python_on_whales.docker.build") as mock_build:
Expand Down Expand Up @@ -728,6 +731,7 @@ def test_build_args_cache_registry_push(self, basic_standard_image_target):
"platforms": ["linux/amd64"],
"target": None,
"secrets": [],
"progress": "auto",
}

with patch("python_on_whales.docker.build") as mock_build:
Expand Down Expand Up @@ -756,6 +760,7 @@ def test_build_args_temp_registry(self, basic_standard_image_target):
"platforms": ["linux/amd64"],
"target": None,
"secrets": [],
"progress": "auto",
}

with patch("python_on_whales.docker.build") as mock_build:
Expand Down Expand Up @@ -785,6 +790,7 @@ def test_build_args_with_target(self, basic_standard_image_target):
"platforms": ["linux/amd64"],
"target": "my-stage",
"secrets": [],
"progress": "auto",
}

with patch("python_on_whales.docker.build") as mock_build:
Expand Down Expand Up @@ -814,6 +820,7 @@ def test_build_args_with_target_from_image(self, basic_standard_image_target):
"platforms": ["linux/amd64"],
"target": "image-stage",
"secrets": [],
"progress": "auto",
}

with patch("python_on_whales.docker.build") as mock_build:
Expand Down Expand Up @@ -844,6 +851,7 @@ def test_build_args_with_target_version_overrides_image(self, basic_standard_ima
"platforms": ["linux/amd64"],
"target": "version-stage",
"secrets": [],
"progress": "auto",
}

with patch("python_on_whales.docker.build") as mock_build:
Expand Down Expand Up @@ -912,6 +920,7 @@ def test_build_args_with_secrets(self, basic_standard_image_target, monkeypatch)
"platforms": ["linux/amd64"],
"target": None,
"secrets": ["id=github_token,env=GITHUB_TOKEN"],
"progress": "auto",
}

with patch("python_on_whales.docker.build") as mock_build:
Expand Down
Loading