gitlab CI: use a separate variable for the template list

Just because I feel more comfortable with having this code in python than in
the templates.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2020-02-20 13:25:40 +10:00
parent 3a7412a4d7
commit 50d916467b
2 changed files with 7 additions and 4 deletions

View file

@ -26,6 +26,8 @@ distributions = [
}
]
templates = sorted(set([x['name'] for x in distributions]))
# in reverse order of duration to get the slowest ones started first
test_suites = [
{'name': 'touchpad', 'suites': 'touchpad'},
@ -44,7 +46,8 @@ def generate_template():
template = env.get_template('gitlab-ci.tmpl')
config = {'distributions': distributions,
'test_suites': test_suites}
'test_suites': test_suites,
'templates': templates}
with open('.gitlab-ci.yml', 'w') as fd:
template.stream(config).dump(fd)

View file

@ -27,11 +27,11 @@
.templates_sha: &template_sha b7030c2cd0d6ccc5f6d4f8299bafa4daa9240d71 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
include:
{% for distribution in distributions|map(attribute='name')|unique()|sort() %}
# {{ distribution.capitalize() }} container builder template
{% for template in templates %}
# {{ template.capitalize() }} container builder template
- project: 'wayland/ci-templates'
ref: *template_sha
file: '/templates/{{distribution}}.yml'
file: '/templates/{{template}}.yml'
{% endfor %}
stages: