2 # vim: set expandtab shiftwidth=4:
4 # This file generates the .gitlab-ci.yml file that defines the pipeline.
11 from pathlib import Path
15 {'name': 'fedora', 'version': '30'},
16 {'name': 'fedora', 'version': '31'},
17 {'name': 'ubuntu', 'version': '19.10'},
18 {'name': 'ubuntu', 'version': '19.04'},
19 {'name': 'debian', 'version': 'stable'},
20 {'name': 'debian', 'version': 'sid'},
22 'name': 'centos', 'version': '7',
25 'MAKE_ARGS': ('\'\' # disable distcheck, requires doxygen'),
31 'name': 'centos', 'version': '8',
34 'MAKE_ARGS': ('\'\' # disable distcheck, requires doxygen'),
39 {'name': 'arch', 'version': 'rolling',
40 'flavor': 'archlinux' }, # see https://gitlab.freedesktop.org/wayland/ci-templates/merge_requests/19
41 {'name': 'alpine', 'version': 'latest'},
44 # The various sources for templating
45 SOURCE_DIR = Path('.gitlab-ci')
46 TEMPLATE_FILE = 'gitlab-ci.tmpl'
49 OUTPUT_FILE = '.gitlab-ci.yml'
51 def generate_template():
52 env = jinja2.Environment(loader=jinja2.FileSystemLoader(os.fspath(SOURCE_DIR)),
53 trim_blocks=True, lstrip_blocks=True)
55 template = env.get_template(TEMPLATE_FILE)
56 config = {'distributions': distributions}
57 with open(BASE_DIR / OUTPUT_FILE, 'w') as fd:
58 template.stream(config).dump(fd)
61 if __name__ == '__main__':
63 This script generates the .gitlab-ci.yml file.
65 It must be run from the git repository root directory and will overwrite
66 the existing .gitlab-ci.yml file.
68 parser = argparse.ArgumentParser(description=description)
71 if not SOURCE_DIR.exists():
72 print('Error: run me from the top-level tree')