Auto-generate the gitlab CI script
[platform/upstream/libevdev.git] / .gitlab-ci / generate-gitlab-ci.py
1 #!/usr/bin/env python3
2 # vim: set expandtab shiftwidth=4:
3
4 # This file generates the .gitlab-ci.yml file that defines the pipeline.
5
6 import jinja2
7
8 distributions = [
9     {'name': 'fedora', 'version': '30'},
10     {'name': 'fedora', 'version': '31'},
11     {'name': 'ubuntu', 'version': '19.10'},
12     {'name': 'ubuntu', 'version': '19.04'},
13     {'name': 'debian', 'version': 'stable'},
14     {'name': 'debian', 'version': 'sid'},
15     {
16         'name': 'centos', 'version': '7',
17         'build': {
18             'extra_variables': {
19                 'MAKE_ARGS': ('\'\'  # disable distcheck, requires doxygen'),
20             }
21         },
22     },
23     {
24         'name': 'centos', 'version': '8',
25         'build': {
26             'extra_variables': {
27                 'MAKE_ARGS': ('\'\'  # disable distcheck, requires doxygen'),
28             }
29         },
30     },
31     {'name': 'arch', 'version': 'rolling',
32      'flavor': 'archlinux' },  # see https://gitlab.freedesktop.org/wayland/ci-templates/merge_requests/19
33     {'name': 'alpine', 'version': 'latest'},
34 ]
35
36
37 def generate_template():
38     env = jinja2.Environment(loader=jinja2.FileSystemLoader('./.gitlab-ci'),
39                              trim_blocks=True, lstrip_blocks=True)
40
41     template = env.get_template('gitlab-ci.tmpl')
42     config = {'distributions': distributions}
43     with open('.gitlab-ci.yml', 'w') as fd:
44         template.stream(config).dump(fd)
45
46
47 if __name__ == '__main__':
48     generate_template()