Commit 98f55779 authored by Peter Hutterer's avatar Peter Hutterer
Browse files

Move the configuration yamls into a config folder



Easier to get an overview of the source when they're not all mixed together.
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent ccdf02de
......@@ -31,14 +31,15 @@ def generate_template(configs, dest, template):
if __name__ == '__main__':
src_folder = Path('src')
config_folder = src_folder / 'config'
ci_folder = Path('.gitlab-ci')
ci_folder.mkdir(exist_ok=True)
globals_file = src_folder / 'ci-globals.yml'
globals_file = config_folder / 'ci-globals.yml'
def is_distribution_file(f):
return f.name.endswith('.yml') and not f.name.startswith('ci-')
for distrib in [x for x in src_folder.iterdir() if is_distribution_file(x)]:
for distrib in [x for x in config_folder.iterdir() if is_distribution_file(x)]:
name = distrib.name[:-4] # drop .yml
# generate the distribution's template file,
......@@ -60,7 +61,7 @@ if __name__ == '__main__':
generate_template(configs=config, dest=dest, template=template)
# Generate the ci-fairy template and its ci file
ci_fairy_file = src_folder / 'ci-fairy.yml'
ci_fairy_file = config_folder / 'ci-fairy.yml'
template = src_folder / 'ci-fairy.tmpl'
dest = Path('templates') / 'ci-fairy.yml'
config = [(f'{globals_file}', ''), (f'{ci_fairy_file}', 'ci-fairy')]
......@@ -91,7 +92,7 @@ if __name__ == '__main__':
s = '", "'.join(sorted(set(remote_images)))
new_config.write(f'remote_images: ["{s}"]\n'.encode('utf8'))
distributions = [d.name[:-4] for d in src_folder.iterdir() if is_distribution_file(d)]
distributions = [d.name[:-4] for d in config_folder.iterdir() if is_distribution_file(d)]
s = '", "'.join(sorted(set(distributions)))
new_config.write(f'distribs: ["{s}"]\n'.encode('utf8'))
new_config.flush()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment