2018-01-30 20:17:30 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
import yaml
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
os.chdir(os.path.abspath(os.path.dirname(__file__)))
|
|
|
|
|
|
|
|
with open("Dockerfile.template") as f:
|
|
|
|
docker_template = f.read()
|
|
|
|
|
|
|
|
with open("images.yml") as f:
|
|
|
|
dockerfile_settings = yaml.safe_load(f)
|
|
|
|
|
|
|
|
for distro in dockerfile_settings:
|
2020-06-09 00:25:09 +02:00
|
|
|
dockerfile_path = f"images/{distro}/Dockerfile"
|
2018-01-31 18:45:48 +01:00
|
|
|
os.makedirs(os.path.dirname(dockerfile_path), exist_ok=True)
|
2018-01-30 20:17:30 +01:00
|
|
|
with open(dockerfile_path, "w") as f:
|
2018-01-31 18:51:54 +01:00
|
|
|
f.write("""\
|
|
|
|
# THIS IS A GENERATED FILE. DO NOT EDIT.
|
2020-06-23 21:36:39 +02:00
|
|
|
# See template: tools/ci/Dockerfile.template
|
2018-01-31 18:51:54 +01:00
|
|
|
|
|
|
|
""")
|
|
|
|
f.write(docker_template.format_map(dockerfile_settings[distro]))
|