Commit 28e71841 authored by Peter Hutterer's avatar Peter Hutterer
Browse files

Rename the globals.yml file to ci-globals.yml



This way all special non-distribution files can have a common prefix ('ci-')
and we can adjust our loops accordingly.
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent a6ecc580
......@@ -33,9 +33,12 @@ if __name__ == '__main__':
src_folder = Path('src')
ci_folder = Path('.gitlab-ci')
ci_folder.mkdir(exist_ok=True)
globals_file = src_folder / 'globals.yml'
for distrib in [x for x in src_folder.iterdir()
if (x.name.endswith('.yml') and x != globals_file)]:
globals_file = src_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)]:
name = distrib.name[:-4] # drop .yml
# generate the distribution's template file,
......@@ -77,8 +80,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 (d.name.endswith('.yml') and d != globals_file)]
distributions = [d.name[:-4] for d in src_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