2022-06-28 11:32:29 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
from os import environ
|
|
|
|
from os.path import dirname
|
|
|
|
from jinja2 import Environment, FileSystemLoader
|
|
|
|
|
2023-03-17 20:40:18 +00:00
|
|
|
def checkEnv(envName, defaultValue):
|
|
|
|
return bool(len(environ[envName])) if envName in environ else defaultValue
|
|
|
|
|
2022-06-28 11:32:29 +00:00
|
|
|
def main():
|
|
|
|
print(Environment(loader=FileSystemLoader(dirname(__file__))).get_template("Dockerfile").render(
|
2023-03-17 20:40:18 +00:00
|
|
|
DEBUG=checkEnv("DEBUG", True),
|
|
|
|
LTO=checkEnv("LTO", True),
|
2022-06-28 11:32:29 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|