mirror of
https://gitlab.com/itsulu-odoo/runboat.git
synced 2026-05-30 23:41:27 +00:00
Add env vars in build settings + alt install method
This commit is contained in:
parent
b0ee0172be
commit
c3e84d1256
3 changed files with 19 additions and 7 deletions
|
|
@ -171,9 +171,9 @@ def make_deployment_vars(
|
|||
commit_info=commit_info,
|
||||
image_name=image_name,
|
||||
image_tag=image_tag,
|
||||
build_env=settings.build_env or {},
|
||||
build_secret_env=settings.build_secret_env or {},
|
||||
build_template_vars=settings.build_template_vars or {},
|
||||
build_env=settings.build_env | build_settings.env,
|
||||
build_secret_env=settings.build_secret_env | build_settings.secret_env,
|
||||
build_template_vars=settings.build_template_vars | build_settings.template_vars,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,15 @@ git fetch origin $RUNBOAT_GIT_REF:build
|
|||
git checkout build
|
||||
|
||||
# Install.
|
||||
oca_install_addons
|
||||
INSTALL_METHOD=${INSTALL_METHOD:-oca_install_addons}
|
||||
if [[ "${INSTALL_METHOD}" == "oca_install_addons" ]] ; then
|
||||
oca_install_addons
|
||||
elif [[ "${INSTALL_METHOD}" == "editable_pip_install" ]] ; then
|
||||
pip install -e .
|
||||
else
|
||||
echo "Unsupported INSTALL_METHOD: '${INSTALL_METHOD}'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Keep a copy of the venv that we can re-use for shorter startup time.
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -yqq install rsync
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ from .exceptions import RepoOrBranchNotSupported
|
|||
|
||||
class BuildSettings(BaseModel):
|
||||
image: str # container image:tag
|
||||
# These extend the respective global settings.
|
||||
env: dict[str, str] = {}
|
||||
secret_env: dict[str, str] = {}
|
||||
template_vars: dict[str, str] = {}
|
||||
|
||||
|
||||
class RepoSettings(BaseModel):
|
||||
|
|
@ -40,13 +44,13 @@ class Settings(BaseSettings):
|
|||
# The wildcard domain where the builds will be reacheable.
|
||||
build_domain: str
|
||||
# A dictionary of environment variables to set in the build container and jobs.
|
||||
build_env: dict[str, str] | None
|
||||
build_env: dict[str, str] = {}
|
||||
# A dictionary of secret environment variables to set in the build container and
|
||||
# jobs.
|
||||
build_secret_env: dict[str, str] | None
|
||||
build_secret_env: dict[str, str] = {}
|
||||
# A dictionary of variables to be set in the jinja rendering context for the
|
||||
# kubefiles.
|
||||
build_template_vars: dict[str, str] | None
|
||||
build_template_vars: dict[str, str] = {}
|
||||
# The token to use for the GitHub api calls (to query branches and pull requests,
|
||||
# and report build statuses).
|
||||
github_token: str | None
|
||||
|
|
|
|||
Loading…
Reference in a new issue