diff --git a/.env.sample b/.env.sample index d0086d6..ad24921 100644 --- a/.env.sample +++ b/.env.sample @@ -8,5 +8,6 @@ RUNBOAT_BUILD_PGUSER=runboat-build RUNBOAT_BUILD_PGPASSWORD=... RUNBOAT_BUILD_ADMIN_PASSWD=... RUNBOAT_BUILD_DOMAIN=runboat.odoo-community.org +RUNBOAT_BUILD_ENV={} RUNBOAT_GITHUB_TOKEN= RUNBOAT_LOG_CONFIG=log-config.yaml diff --git a/README.md b/README.md index 024de43..5004390 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,7 @@ More: - create builds for all supported repos on startup (goes with sticky branches) - never undeploy last build of sticky branches - make build images configurable (see `build_images.py`) +- configurable kubefiles directory ## Author and contributors diff --git a/src/runboat/k8s.py b/src/runboat/k8s.py index 579c927..d507c31 100644 --- a/src/runboat/k8s.py +++ b/src/runboat/k8s.py @@ -141,6 +141,7 @@ class DeploymentVars(BaseModel): pgdatabase: str admin_passwd: str hostname: str + build_env: dict[str, str] def make_deployment_vars( @@ -171,6 +172,7 @@ def make_deployment_vars( pgdatabase=build_name, admin_passwd=settings.build_admin_passwd, hostname=f"{slug}.{settings.build_domain}", + build_env=settings.build_env or {}, ) diff --git a/src/runboat/kubefiles/kustomization.yaml.jinja b/src/runboat/kubefiles/kustomization.yaml.jinja index 58e4e8c..74ccc52 100644 --- a/src/runboat/kubefiles/kustomization.yaml.jinja +++ b/src/runboat/kubefiles/kustomization.yaml.jinja @@ -44,6 +44,9 @@ configMapGenerator: - ADDONS_DIR=/build - RUNBOAT_GIT_REPO=https://github.com/{{ repo }} - RUNBOAT_GIT_REF={{ git_commit }} + {%- for key, value in build_env.items() %} + - {{ key }}={{ value }} + {%- endfor %} - name: runboat-scripts files: - runboat-clone-and-install.sh diff --git a/src/runboat/settings.py b/src/runboat/settings.py index c261c1c..7c796ab 100644 --- a/src/runboat/settings.py +++ b/src/runboat/settings.py @@ -17,6 +17,7 @@ class Settings(BaseSettings): build_pgpassword: str build_admin_passwd: str build_domain: str + build_env: Optional[dict[str, str]] github_token: Optional[str] log_config: Optional[str]