1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-12-04 21:38:29 +00:00

Generate Dockerfiles from one source for maintainability. Closes #785.

This commit is contained in:
Robin Schneider 2019-12-28 22:52:01 +01:00
commit 8280d200ea
No known key found for this signature in database
GPG key ID: A81E8006DC95EFE6
15 changed files with 615 additions and 148 deletions

17
docker/render_template Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env python3
import os, argparse, json
import jinja2
args_parser = argparse.ArgumentParser()
args_parser.add_argument('template_file', help='Jinja2 template file to render.')
args_parser.add_argument('render_vars', help='JSON-encoded data to pass to the templating engine.')
cli_args = args_parser.parse_args()
render_vars = json.loads(cli_args.render_vars)
environment = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.getcwd()),
trim_blocks=True,
)
print(environment.get_template(cli_args.template_file).render(render_vars))