feat: add install script packaging
This commit is contained in:
@@ -58,10 +58,17 @@ from .sidecar_bundle import (
|
||||
)
|
||||
|
||||
|
||||
# Repo root, used as the build context for the bundle Dockerfile.
|
||||
# Repo root or installed site-packages root, used as the build context for
|
||||
# Dockerfiles that COPY bot_bottle source files.
|
||||
_REPO_DIR = str(Path(__file__).resolve().parent.parent.parent.parent)
|
||||
|
||||
|
||||
def _sidecar_bundle_dockerfile() -> str:
|
||||
if (Path(_REPO_DIR) / SIDECAR_BUNDLE_DOCKERFILE).is_file():
|
||||
return SIDECAR_BUNDLE_DOCKERFILE
|
||||
return f"bot_bottle/{SIDECAR_BUNDLE_DOCKERFILE}"
|
||||
|
||||
|
||||
def bottle_plan_to_compose(plan: DockerBottlePlan) -> dict[str, Any]:
|
||||
"""Render a Compose v2 spec dict from a fully-resolved
|
||||
DockerBottlePlan.
|
||||
@@ -183,7 +190,7 @@ def _sidecar_bundle_service(plan: DockerBottlePlan) -> dict[str, Any]:
|
||||
"image": SIDECAR_BUNDLE_IMAGE,
|
||||
"build": {
|
||||
"context": _REPO_DIR,
|
||||
"dockerfile": SIDECAR_BUNDLE_DOCKERFILE,
|
||||
"dockerfile": _sidecar_bundle_dockerfile(),
|
||||
},
|
||||
"container_name": sidecar_bundle_container_name(plan.slug),
|
||||
"networks": {
|
||||
|
||||
Reference in New Issue
Block a user