Skip to content

Commit

Permalink
Use json.dumps to render deployment params that are to be put as envi…
Browse files Browse the repository at this point in the history
…ronment variables
  • Loading branch information
ricardogsilva committed Dec 6, 2024
1 parent 25db9a3 commit 889723d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion deployments/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,10 @@ def handle(self) -> None:
# collections, for example cors origins, which is a list of strings
for k, v in render_context.items():
if "_env_" in k:
render_kwargs[k] = json.dumps(v)
try:
render_kwargs[k] = json.dumps(v)
except TypeError:
render_kwargs[k] = json.dumps(str(v))

rendered = compose_template.substitute(render_context, **render_kwargs)
target_path = Path(self.config.deployment_root / "compose.production.yaml")
Expand Down

0 comments on commit 889723d

Please sign in to comment.