Skip to content

Commit

Permalink
Merge pull request #2049 from SUSE/git_readme
Browse files Browse the repository at this point in the history
README for the git container
  • Loading branch information
dcermak authored Nov 28, 2024
2 parents 87e4a26 + 5edfcfb commit b7d0485
Show file tree
Hide file tree
Showing 4 changed files with 88 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
]
29 changes: 29 additions & 0 deletions src/bci_build/package/git/README.md.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# {{ image.title }}: Git application container
{% include 'badges.j2' %}


## Description

Git is a distributed version control system that tracks
versions of files. Git is primarily designed for controlling source code in collaborative software development.


## Usage

This container provides the {{ image.publish_registry.vendor }} version of Git.

Example of using Git container:

```ShellSession
$ podman run {{ image.pretty_reference }} git help
```

As Git requires a repository, the container
does not explicitly set an entrypoint. This way, you can launch the container in
interactive mode to clone a repository and work on it. To avoid losing all your changes when exiting the container, use a persistent volume mount on launch.

For more use cases and documentation, refer to the
[Git SCM documentation](https://git-scm.com/doc).


{% include 'licensing_and_eula.j2' %}

0 comments on commit b7d0485

Please sign in to comment.