Skip to content

Commit

Permalink
Override frontend auto-added dependencies with BONFIRE_FRONTEND_DEPEN…
Browse files Browse the repository at this point in the history
…DENCIES env var (#320)

* Override frontend auto-added dependencies with BONFIRE_FRONTEND_DEPENDENCIES env var

* Incorporate suggested changes

* Improved logic
  • Loading branch information
bsquizz authored Aug 23, 2023
1 parent a3abe89 commit fa46833
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions bonfire/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
# set to true when bonfire is running via automation using a bot acct (not an end user)
BONFIRE_BOT = os.getenv("BONFIRE_BOT")

AUTO_ADDED_FRONTEND_DEPENDENCIES = (
DEFAULT_FRONTEND_DEPENDENCIES = (
"chrome-service",
"landing-page-frontend",
"insights-chrome",
Expand All @@ -63,10 +63,21 @@
"rbac-frontend",
"host-inventory",
"host-inventory-frontend",
"unleash-proxy"
"unleash-proxy",
)


def _get_auto_added_frontend_dependencies():
env_var = os.getenv("BONFIRE_FRONTEND_DEPENDENCIES")

if env_var is None:
return set(DEFAULT_FRONTEND_DEPENDENCIES)
return set([val.strip() for val in env_var.split(",") if val.strip()])


AUTO_ADDED_FRONTEND_DEPENDENCIES = _get_auto_added_frontend_dependencies()


def write_default_config(outpath=None):
outpath = Path(outpath) if outpath else DEFAULT_CONFIG_PATH
outpath.parent.mkdir(mode=0o700, parents=True, exist_ok=True)
Expand Down

0 comments on commit fa46833

Please sign in to comment.