summaryrefslogtreecommitdiff
path: root/.gitlab-ci/ci.template
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-04-13 08:34:16 +0200
committerThomas Haller <thaller@redhat.com>2023-04-13 09:10:59 +0200
commitafe098a9285b8304d9eaa126803bb419baa3e3eb (patch)
tree42f9fadb2633f34be3e7c58c76c594b51986a514 /.gitlab-ci/ci.template
parent8e37037e8830a40c97d6bb8992b3c4b9eb3fcc09 (diff)
downloadNetworkManager-afe098a9285b8304d9eaa126803bb419baa3e3eb.tar.gz
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.
Diffstat (limited to '.gitlab-ci/ci.template')
-rw-r--r--.gitlab-ci/ci.template10
1 files changed, 5 insertions, 5 deletions
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: