diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2020-02-20 13:25:40 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2020-02-20 13:39:32 +1000 |
commit | 50d916467b75e5ca8944f8b4031d47dfd82a1847 (patch) | |
tree | 9399ecf6ff1fdb9ab8e9e4252366bd4f3b39a664 | |
parent | 3a7412a4d78d8635c8b581728851ec60668a8319 (diff) |
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>
-rwxr-xr-x | .gitlab-ci/generate-gitlab-ci.py | 5 | ||||
-rw-r--r-- | .gitlab-ci/gitlab-ci.tmpl | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/.gitlab-ci/generate-gitlab-ci.py b/.gitlab-ci/generate-gitlab-ci.py index b3a05075..1b8720a7 100755 --- a/.gitlab-ci/generate-gitlab-ci.py +++ b/.gitlab-ci/generate-gitlab-ci.py @@ -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) diff --git a/.gitlab-ci/gitlab-ci.tmpl b/.gitlab-ci/gitlab-ci.tmpl index 4d903f1c..102e9708 100644 --- a/.gitlab-ci/gitlab-ci.tmpl +++ b/.gitlab-ci/gitlab-ci.tmpl @@ -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: |