Runboat does not need to know about postgres at all
This commit is contained in:
parent
43e0e5f0d1
commit
24d9be3b0c
7 changed files with 36 additions and 40 deletions
|
|
@ -2,11 +2,8 @@ RUNBOAT_SUPPORTED_REPOS=["OCA/mis-builder", "shopinvader/odoo-shopinvader", "OCA
|
||||||
RUNBOAT_API_ADMIN_USER="admin"
|
RUNBOAT_API_ADMIN_USER="admin"
|
||||||
RUNBOAT_API_ADMIN_PASSWD="admin"
|
RUNBOAT_API_ADMIN_PASSWD="admin"
|
||||||
RUNBOAT_BUILD_NAMESPACE=runboat-builds
|
RUNBOAT_BUILD_NAMESPACE=runboat-builds
|
||||||
RUNBOAT_BUILD_PGHOST=postgres14.runboat-builds-db
|
|
||||||
RUNBOAT_BUILD_PGPORT=5432
|
|
||||||
RUNBOAT_BUILD_PGUSER=runboat-build
|
|
||||||
RUNBOAT_BUILD_PGPASSWORD=...
|
|
||||||
RUNBOAT_BUILD_DOMAIN=runboat.odoo-community.org
|
RUNBOAT_BUILD_DOMAIN=runboat.odoo-community.org
|
||||||
RUNBOAT_BUILD_ENV={}
|
RUNBOAT_BUILD_ENV={"PGHOST": "postgres14.runboat-builds-db", "PGPORT": "5432", "PGUSER": "runboat-build"}
|
||||||
|
RUNBOAT_BUILD_SECRET_ENV={"PGPASSWORD": "..."}
|
||||||
RUNBOAT_GITHUB_TOKEN=
|
RUNBOAT_GITHUB_TOKEN=
|
||||||
RUNBOAT_LOG_CONFIG=log-config.yaml
|
RUNBOAT_LOG_CONFIG=log-config.yaml
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,9 @@ RUNBOAT_SUPPORTED_REPOS=["OCA/mis-builder", "shopinvader/odoo-shopinvader", "OCA
|
||||||
RUNBOAT_API_ADMIN_USER="admin"
|
RUNBOAT_API_ADMIN_USER="admin"
|
||||||
RUNBOAT_API_ADMIN_PASSWD="admin"
|
RUNBOAT_API_ADMIN_PASSWD="admin"
|
||||||
RUNBOAT_BUILD_NAMESPACE=runboat-builds
|
RUNBOAT_BUILD_NAMESPACE=runboat-builds
|
||||||
RUNBOAT_BUILD_PGHOST=postgres14.runboat-builds-db
|
|
||||||
RUNBOAT_BUILD_PGPORT=5432
|
|
||||||
RUNBOAT_BUILD_PGUSER=runboat-build
|
|
||||||
RUNBOAT_BUILD_PGPASSWORD=...
|
|
||||||
RUNBOAT_BUILD_DOMAIN=runboat.odoo-community.org
|
RUNBOAT_BUILD_DOMAIN=runboat.odoo-community.org
|
||||||
RUNBOAT_BUILD_ENV={}
|
RUNBOAT_BUILD_ENV={}
|
||||||
|
RUNBOAT_BUILD_SECRET_ENV={}
|
||||||
RUNBOAT_GITHUB_TOKEN=
|
RUNBOAT_GITHUB_TOKEN=
|
||||||
RUNBOAT_LOG_CONFIG=log-config.yaml
|
RUNBOAT_LOG_CONFIG=log-config.yaml
|
||||||
RUNBOAT_BIULD_IMAGES={"15.0": "ghcr.io/oca/oca-ci/py3.8-odoo15.0:latest"}
|
RUNBOAT_BUILD_IMAGES={"15.0": "ghcr.io/oca/oca-ci/py3.8-odoo15.0:latest"}
|
||||||
|
|
|
||||||
10
Dockerfile
10
Dockerfile
|
|
@ -12,15 +12,13 @@ ENV PYTHONPATH=/app
|
||||||
|
|
||||||
COPY log-config.yaml /etc/runboat-log-config.yaml
|
COPY log-config.yaml /etc/runboat-log-config.yaml
|
||||||
|
|
||||||
ENV RUNBOAT_SUPPORTED_REPOS='["oca/server-env", "oca/mis-builder"]'
|
ENV RUNBOAT_SUPPORTED_REPOS='["OCA/mis-builder", "shopinvader/odoo-shopinvader", "OCA/server-env"]''
|
||||||
ENV RUNBOAT_API_ADMIN_USER="admin"
|
ENV RUNBOAT_API_ADMIN_USER="admin"
|
||||||
ENV RUNBOAT_API_ADMIN_PASSWD=
|
ENV RUNBOAT_API_ADMIN_PASSWD="admin"
|
||||||
ENV RUNBOAT_BUILD_NAMESPACE=runboat-builds
|
ENV RUNBOAT_BUILD_NAMESPACE=runboat-builds
|
||||||
ENV RUNBOAT_BUILD_PGHOST=postgres14.runboat-builds-db
|
|
||||||
ENV RUNBOAT_BUILD_PGPORT=5432
|
|
||||||
ENV RUNBOAT_BUILD_PGUSER=runboat-build
|
|
||||||
ENV RUNBOAT_BUILD_PGPASSWORD=
|
|
||||||
ENV RUNBOAT_BUILD_DOMAIN=runboat.example.com
|
ENV RUNBOAT_BUILD_DOMAIN=runboat.example.com
|
||||||
|
ENV RUNBOAT_BUILD_ENV='{"PGHOST": "postgres14.runboat-builds-db", "PGPORT": "5432", "PGUSER": "runboat-build"}'
|
||||||
|
ENV RUNBOAT_BUILD_SECRET_ENV='{"PGPASSWORD": "..."}'
|
||||||
ENV RUNBOAT_GITHUB_TOKEN=
|
ENV RUNBOAT_GITHUB_TOKEN=
|
||||||
ENV RUNBOAT_LOG_CONFIG=/etc/runboat-log-config.yaml
|
ENV RUNBOAT_LOG_CONFIG=/etc/runboat-log-config.yaml
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,8 @@ in a different cluster.
|
||||||
|
|
||||||
## Developing
|
## Developing
|
||||||
|
|
||||||
- setup environment variables (start from `.env.sample`)
|
- setup environment variables (start from `.env.sample`, the meaning of the environment
|
||||||
|
variables is documented in [settings.py](./src/runboat/settings.py))
|
||||||
- create a virtualenv, make sure to have pip>=21.3.1 and `pip install -c
|
- create a virtualenv, make sure to have pip>=21.3.1 and `pip install -c
|
||||||
requirements.txt -e .[test]`
|
requirements.txt -e .[test]`
|
||||||
- run with `uvicorn runboat.app:app --log-config=log-config.yaml`
|
- run with `uvicorn runboat.app:app --log-config=log-config.yaml`
|
||||||
|
|
|
||||||
|
|
@ -128,19 +128,16 @@ class DeploymentVars(BaseModel):
|
||||||
namespace: str
|
namespace: str
|
||||||
mode: DeploymentMode
|
mode: DeploymentMode
|
||||||
build_name: str
|
build_name: str
|
||||||
|
build_slug: str
|
||||||
|
build_domain: str
|
||||||
repo: str
|
repo: str
|
||||||
target_branch: str
|
target_branch: str
|
||||||
pr: Optional[int]
|
pr: Optional[int]
|
||||||
git_commit: str
|
git_commit: str
|
||||||
image_name: str
|
image_name: str
|
||||||
image_tag: str
|
image_tag: str
|
||||||
pghost: str
|
|
||||||
pgport: str
|
|
||||||
pguser: str
|
|
||||||
pgpassword: str
|
|
||||||
pgdatabase: str
|
|
||||||
hostname: str
|
|
||||||
build_env: dict[str, str]
|
build_env: dict[str, str]
|
||||||
|
build_secret_env: dict[str, str]
|
||||||
|
|
||||||
|
|
||||||
def make_deployment_vars(
|
def make_deployment_vars(
|
||||||
|
|
@ -158,19 +155,16 @@ def make_deployment_vars(
|
||||||
mode=mode,
|
mode=mode,
|
||||||
namespace=settings.build_namespace,
|
namespace=settings.build_namespace,
|
||||||
build_name=build_name,
|
build_name=build_name,
|
||||||
|
build_slug=slug,
|
||||||
|
build_domain=settings.build_domain,
|
||||||
repo=repo,
|
repo=repo,
|
||||||
target_branch=target_branch,
|
target_branch=target_branch,
|
||||||
pr=pr,
|
pr=pr,
|
||||||
git_commit=git_commit,
|
git_commit=git_commit,
|
||||||
image_name=image_name,
|
image_name=image_name,
|
||||||
image_tag=image_tag,
|
image_tag=image_tag,
|
||||||
pghost=settings.build_pghost,
|
|
||||||
pgport=settings.build_pgport,
|
|
||||||
pguser=settings.build_pguser,
|
|
||||||
pgpassword=settings.build_pgpassword,
|
|
||||||
pgdatabase=build_name,
|
|
||||||
hostname=f"{slug}.{settings.build_domain}",
|
|
||||||
build_env=settings.build_env or {},
|
build_env=settings.build_env or {},
|
||||||
|
build_secret_env=settings.build_secret_env or {},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,16 +30,14 @@ images:
|
||||||
secretGenerator:
|
secretGenerator:
|
||||||
- name: odoosecretenv
|
- name: odoosecretenv
|
||||||
literals:
|
literals:
|
||||||
- PGPASSWORD={{ pgpassword }}
|
{%- for key, value in build_secret_env.items() %}
|
||||||
|
- {{ key }}={{ value }}
|
||||||
|
{%- endfor %}
|
||||||
|
|
||||||
configMapGenerator:
|
configMapGenerator:
|
||||||
- name: odooenv
|
- name: odooenv
|
||||||
literals:
|
literals:
|
||||||
- PGHOST={{ pghost }}
|
- PGDATABASE={{ build_name }}
|
||||||
- PGPORT={{ pgport }}
|
|
||||||
- PGUSER={{ pguser }}
|
|
||||||
- PGNAME={{ pgname }}
|
|
||||||
- PGDATABASE={{ pgdatabase }}
|
|
||||||
- ADDONS_DIR=/build
|
- ADDONS_DIR=/build
|
||||||
- RUNBOAT_GIT_REPO=https://github.com/{{ repo }}
|
- RUNBOAT_GIT_REPO=https://github.com/{{ repo }}
|
||||||
- RUNBOAT_GIT_REF={{ git_commit }}
|
- RUNBOAT_GIT_REF={{ git_commit }}
|
||||||
|
|
@ -55,7 +53,7 @@ configMapGenerator:
|
||||||
{% if mode == 'deployment' -%}
|
{% if mode == 'deployment' -%}
|
||||||
- name: vars
|
- name: vars
|
||||||
literals:
|
literals:
|
||||||
- HOSTNAME={{ hostname }}
|
- HOSTNAME={{ build_slug }}.{{ build_domain }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
generatorOptions:
|
generatorOptions:
|
||||||
|
|
|
||||||
|
|
@ -4,19 +4,27 @@ from pydantic import BaseSettings, validator
|
||||||
|
|
||||||
|
|
||||||
class Settings(BaseSettings):
|
class Settings(BaseSettings):
|
||||||
|
# A user and password to protect the most sensitive operations of the API.
|
||||||
api_admin_user: str
|
api_admin_user: str
|
||||||
api_admin_passwd: str
|
api_admin_passwd: str
|
||||||
|
# A JSON list of supported repositories in the form owner/repo.
|
||||||
supported_repos: set[str]
|
supported_repos: set[str]
|
||||||
|
# The maximum number of concurrent initialization jobs.
|
||||||
max_initializing: int = 2
|
max_initializing: int = 2
|
||||||
|
# The maximum number of builds that are started.
|
||||||
max_started: int = 6
|
max_started: int = 6
|
||||||
|
# The maximum number of builds that are deployed.
|
||||||
max_deployed: int = 10
|
max_deployed: int = 10
|
||||||
|
# The kubernetes namespace where the builds are deployed.
|
||||||
build_namespace: str
|
build_namespace: str
|
||||||
build_pghost: str
|
# The wildcard domain where the builds will be reacheable.
|
||||||
build_pgport: str
|
|
||||||
build_pguser: str
|
|
||||||
build_pgpassword: str
|
|
||||||
build_domain: str
|
build_domain: str
|
||||||
|
# A dictionary of environment variables to set in the build container and jobs.
|
||||||
build_env: Optional[dict[str, str]]
|
build_env: Optional[dict[str, str]]
|
||||||
|
# A dictionary of secret environment variables to set in the build container and
|
||||||
|
# jobs.
|
||||||
|
build_secret_env: Optional[dict[str, str]]
|
||||||
|
# A mapping of main branch names to container images used to run the builds.
|
||||||
build_images: dict[str, str] = {
|
build_images: dict[str, str] = {
|
||||||
"15.0": "ghcr.io/oca/oca-ci/py3.8-odoo15.0:latest",
|
"15.0": "ghcr.io/oca/oca-ci/py3.8-odoo15.0:latest",
|
||||||
"14.0": "ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest",
|
"14.0": "ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest",
|
||||||
|
|
@ -25,7 +33,10 @@ class Settings(BaseSettings):
|
||||||
"11.0": "ghcr.io/oca/oca-ci/py3.5-odoo11.0:latest",
|
"11.0": "ghcr.io/oca/oca-ci/py3.5-odoo11.0:latest",
|
||||||
"10.0": "ghcr.io/oca/oca-ci/py2.7-odoo10.0:latest",
|
"10.0": "ghcr.io/oca/oca-ci/py2.7-odoo10.0:latest",
|
||||||
}
|
}
|
||||||
|
# The token to use for the GitHub api calls (to query branches and pull requests,
|
||||||
|
# and report build statuses).
|
||||||
github_token: Optional[str]
|
github_token: Optional[str]
|
||||||
|
# The file with the python logging configuration to use for the runboat controller.
|
||||||
log_config: Optional[str]
|
log_config: Optional[str]
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue