Merge pull request #41 from sbidoul/alt-install-method

Alt install method
This commit is contained in:
Stéphane Bidoul 2022-01-29 12:01:22 +01:00 committed by GitHub
commit 37dae56d35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 7 deletions

View file

@ -171,9 +171,9 @@ def make_deployment_vars(
commit_info=commit_info, commit_info=commit_info,
image_name=image_name, image_name=image_name,
image_tag=image_tag, image_tag=image_tag,
build_env=settings.build_env or {}, build_env=settings.build_env | build_settings.env,
build_secret_env=settings.build_secret_env or {}, build_secret_env=settings.build_secret_env | build_settings.secret_env,
build_template_vars=settings.build_template_vars or {}, build_template_vars=settings.build_template_vars | build_settings.template_vars,
) )

View file

@ -15,7 +15,15 @@ git fetch origin $RUNBOAT_GIT_REF:build
git checkout build git checkout build
# Install. # Install.
INSTALL_METHOD=${INSTALL_METHOD:-oca_install_addons}
if [[ "${INSTALL_METHOD}" == "oca_install_addons" ]] ; then
oca_install_addons 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. # Keep a copy of the venv that we can re-use for shorter startup time.
DEBIAN_FRONTEND=noninteractive apt-get -yqq install rsync DEBIAN_FRONTEND=noninteractive apt-get -yqq install rsync

View file

@ -7,6 +7,10 @@ from .exceptions import RepoOrBranchNotSupported
class BuildSettings(BaseModel): class BuildSettings(BaseModel):
image: str # container image:tag 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): class RepoSettings(BaseModel):
@ -40,13 +44,13 @@ class Settings(BaseSettings):
# The wildcard domain where the builds will be reacheable. # The wildcard domain where the builds will be reacheable.
build_domain: str build_domain: str
# A dictionary of environment variables to set in the build container and jobs. # 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 # A dictionary of secret environment variables to set in the build container and
# jobs. # 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 # A dictionary of variables to be set in the jinja rendering context for the
# kubefiles. # 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, # The token to use for the GitHub api calls (to query branches and pull requests,
# and report build statuses). # and report build statuses).
github_token: str | None github_token: str | None