Skip to content

Commit

Permalink
Split git container into its own top level module
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmueller committed Nov 28, 2024
1 parent d1ddaf0 commit a172082
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/bci_build/package/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,6 @@ def generate_disk_size_constraints(size_gb: int) -> str:
from .apache_tomcat import TOMCAT_CONTAINERS # noqa: E402
from .appcontainers import ALERTMANAGER_CONTAINERS # noqa: E402
from .appcontainers import BLACKBOX_EXPORTER_CONTAINERS # noqa: E402
from .appcontainers import GIT_CONTAINERS # noqa: E402
from .appcontainers import GRAFANA_CONTAINERS # noqa: E402
from .appcontainers import HELM_CONTAINERS # noqa: E402
from .appcontainers import NGINX_CONTAINERS # noqa: E402
Expand All @@ -1457,6 +1456,7 @@ def generate_disk_size_constraints(size_gb: int) -> str:
from .basecontainers import MINIMAL_CONTAINERS # noqa: E402
from .cosign import COSIGN_CONTAINERS # noqa: E402
from .gcc import GCC_CONTAINERS # noqa: E402
from .git import GIT_CONTAINERS # noqa: E402
from .golang import GOLANG_CONTAINERS # noqa: E402
from .kea import KEA_DHCP_CONTAINERS # noqa: E402
from .kiwi import KIWI_CONTAINERS # noqa: E402
Expand Down
43 changes: 0 additions & 43 deletions src/bci_build/package/appcontainers.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,49 +345,6 @@ def _get_nginx_kwargs(os_version: OsVersion):
for os_version in ALL_NONBASE_OS_VERSIONS
]

GIT_CONTAINERS = [
ApplicationStackContainer(
name="git",
os_version=os_version,
support_level=SupportLevel.L3,
pretty_name=f"{os_version.pretty_os_version_no_dash} with Git",
custom_description="A micro environment with Git {based_on_container}.",
from_image=generate_from_image_tag(os_version, "bci-micro"),
build_recipe_type=BuildType.KIWI,
is_latest=os_version in CAN_BE_LATEST_OS_VERSION,
version="%%git_version%%",
tag_version=format_version(
get_pkg_version("git", os_version), ParseVersion.MINOR
),
additional_versions=["%%git_major_version%%"],
version_in_uid=False,
replacements_via_service=[
Replacement(
regex_in_build_description="%%git_version%%",
package_name="git-core",
),
Replacement(
regex_in_build_description="%%git_major_version%%",
package_name="git-core",
parse_version=ParseVersion.MAJOR,
),
],
license="GPL-2.0-only",
package_list=[
Package(name, pkg_type=PackageType.BOOTSTRAP)
for name in (
"git-core",
"openssh-clients",
)
+ (() if os_version == OsVersion.TUMBLEWEED else ("skelcd-EULA-bci",))
],
# intentionally empty
config_sh_script="""
""",
)
for os_version in ALL_NONBASE_OS_VERSIONS
]


REGISTRY_CONTAINERS = [
ApplicationStackContainer(
Expand Down
58 changes: 58 additions & 0 deletions src/bci_build/package/git.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
"""Container description for the Git application container."""

from bci_build.container_attributes import BuildType
from bci_build.container_attributes import PackageType
from bci_build.container_attributes import SupportLevel
from bci_build.os_version import ALL_NONBASE_OS_VERSIONS
from bci_build.os_version import CAN_BE_LATEST_OS_VERSION
from bci_build.os_version import OsVersion
from bci_build.package import ApplicationStackContainer
from bci_build.package import Package
from bci_build.package import ParseVersion
from bci_build.package import Replacement
from bci_build.package.helpers import generate_from_image_tag
from bci_build.package.versions import format_version
from bci_build.package.versions import get_pkg_version

GIT_CONTAINERS = [
ApplicationStackContainer(
name="git",
os_version=os_version,
support_level=SupportLevel.L3,
pretty_name=f"{os_version.pretty_os_version_no_dash} with Git",
custom_description="A micro environment with Git {based_on_container}.",
from_image=generate_from_image_tag(os_version, "bci-micro"),
build_recipe_type=BuildType.KIWI,
is_latest=os_version in CAN_BE_LATEST_OS_VERSION,
version="%%git_version%%",
tag_version=format_version(
get_pkg_version("git", os_version), ParseVersion.MINOR
),
additional_versions=["%%git_major_version%%"],
version_in_uid=False,
replacements_via_service=[
Replacement(
regex_in_build_description="%%git_version%%",
package_name="git-core",
),
Replacement(
regex_in_build_description="%%git_major_version%%",
package_name="git-core",
parse_version=ParseVersion.MAJOR,
),
],
license="GPL-2.0-only",
package_list=[
Package(name, pkg_type=PackageType.BOOTSTRAP)
for name in (
"git-core",
"openssh-clients",
)
+ (() if os_version == OsVersion.TUMBLEWEED else ("skelcd-EULA-bci",))
],
# intentionally empty
config_sh_script="""
""",
)
for os_version in ALL_NONBASE_OS_VERSIONS
]

0 comments on commit a172082

Please sign in to comment.