Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/docker image name registry and multiple project yaml #1

Merged
merged 9 commits into from
Dec 16, 2024
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
2 changes: 1 addition & 1 deletion src/kapla/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.32.0"
__version__ = "0.33.0"
7 changes: 4 additions & 3 deletions src/kapla/core/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ def configure_logger(level: Optional[int] = None) -> None:
# Optionally fetch logging level from environment variable
if level is None:
level_str = os.environ.get("LOGGING_LEVEL", NOTSET)
level = logging.getLevelName(level_str)
if not isinstance(level, int):
raise ValueError(f"Logging level not supported: {level}")
level_ = logging.getLevelName(level_str)
if not isinstance(level_, int):
raise ValueError(f"Logging level not supported: {level_}")
level = level_
structlog.configure(
processors=[
structlog.processors.add_log_level,
Expand Down
13 changes: 10 additions & 3 deletions src/kapla/projects/kproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,10 +720,17 @@ async def build_docker(
cmd.add_option("--label", f"git.branch.name={git_infos.branch}")
if git_infos.commit:
cmd.add_option("--label", f"git.commit={git_infos.commit}")
list_images = []
# Add tag
cmd.add_option("--tag", ":".join([spec.image + suffix, tag]))
for tag in additional_tags or []:
cmd.add_option("--tag", ":".join([spec.image + suffix, tag]))
if spec.images is not None:
list_images = spec.images
elif spec.image is not None:
list_images = [spec.image]

for image in list_images:
cmd.add_option("--tag", ":".join([image + suffix, tag]))
for tag in additional_tags or []:
cmd.add_option("--tag", ":".join([image + suffix, tag]))
if load:
cmd.add_option("--load")
if push:
Expand Down
2 changes: 1 addition & 1 deletion src/kapla/projects/krepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def discover_projects(
for workspace_directory in all_workspaces[name]:
# Find files named "project.yml" or "project.yaml" starting from the workspace
for filepath in find_files_using_gitignore(
("project.yml", "project.yaml"),
("project.yml", "project.yaml", "project_encrypted.yml", "project_encrypted.yaml"),
root=workspace_directory,
):
# Create a new instance of KProject
Expand Down
3 changes: 2 additions & 1 deletion src/kapla/specs/kproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@


class DockerSpec(AliasedModel):
image: str
images: Optional[List[str]]
image: Optional[str]
base_image: Optional[str] = None
template: Optional[str] = None
options: Optional[Mapping[str, Any]] = None
Expand Down
Loading