From afe098a9285b8304d9eaa126803bb419baa3e3eb Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 13 Apr 2023 08:34:16 +0200 Subject: gitlab-ci: extract base_type for distros to reduce redundant information The distro.name is not just a pretty name, its the name under which we fetch the container. It is thus a well-known name, that we can rely on. The "base_type" only depends on the distro name, and it makes no sense to ever choose a different name. Tracking it in the "distributions" array is thus redundant. Move the mapping of distro.name to the base type to a separate place. --- .gitlab-ci/ci.template | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to '.gitlab-ci/ci.template') diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index 521896ea00..da7a51f369 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -17,10 +17,10 @@ .templates_sha: &template_sha ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2 # see https://docs.gitlab.com/ee/ci/yaml/#includefile -{# Group distros by their common (name,base_type) tuples.#} +{# Group distros by their common (name,) tuples.#} {% set distro_groups = [] %} {% for distro in distributions %} - {% set g = {'name':distro.name,'base_type':distro.base_type} %} + {% set g = {'name':distro.name} %} {% if g not in distro_groups %} {% do distro_groups.append(g) %} {% endif %} @@ -65,13 +65,13 @@ variables: {{"%-13s"| format(distro_group.name.upper() + '_TAG:')}}'tag-{{ (ci_fairy.hashfiles('./.gitlab-ci/config.yml', './.gitlab-ci/ci.template', - './.gitlab-ci/' + distro_group.base_type + '-install.sh', - './contrib/' + distro_group.base_type + '/REQUIRED_PACKAGES'))[0:12] + './.gitlab-ci/' + base_types[distro_group.name] + '-install.sh', + './contrib/' + base_types[distro_group.name] + '/REQUIRED_PACKAGES'))[0:12] }}' {% endfor %} {% for distro_group in distro_groups|sort(attribute='name') %} - {{"%-13s"| format(distro_group.name.upper() + '_EXEC:')}}'bash .gitlab-ci/{{distro_group.base_type}}-install.sh' + {{"%-13s"| format(distro_group.name.upper() + '_EXEC:')}}'bash .gitlab-ci/{{base_types[distro_group.name]}}-install.sh' {% endfor %} .nm_artifacts: -- cgit v1.2.1