gitlab CI: prettify the include of templates
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 4 Jan 2023 04:41:03 +0000 (14:41 +1000)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 17 Nov 2023 10:55:47 +0000 (19:55 +0900)
Identical to libinput commit c8c825289f1b7575ee10b849c04f5caa60483a7e by
Benjamin Tissoires.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
.gitlab-ci.yml
.gitlab-ci/ci.template

index a8853a7d6516035138dbfb6e651045105824578c..bd0e9c9efd31ad7fbc1d1cebffb88d3660aa10ec 100644 (file)
@@ -7,26 +7,19 @@
 .templates_sha: &template_sha 0c312d9c7255f46e741d43bcd1930f09cd12efe7 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
 
 include:
-  # Alpine container builder template
   - project: 'freedesktop/ci-templates'
     ref: *template_sha
-    file: '/templates/alpine.yml'
-  # Arch container builder template
-  - project: 'freedesktop/ci-templates'
-    ref: *template_sha
-    file: '/templates/arch.yml'
-  # Debian container builder template
-  - project: 'freedesktop/ci-templates'
-    ref: *template_sha
-    file: '/templates/debian.yml'
-  # Fedora container builder template
-  - project: 'freedesktop/ci-templates'
-    ref: *template_sha
-    file: '/templates/fedora.yml'
-  # Ubuntu container builder template
-  - project: 'freedesktop/ci-templates'
-    ref: *template_sha
-    file: '/templates/ubuntu.yml'
+    file:
+      # Alpine container builder template
+      - '/templates/alpine.yml'
+      # Arch container builder template
+      - '/templates/arch.yml'
+      # Debian container builder template
+      - '/templates/debian.yml'
+      # Fedora container builder template
+      - '/templates/fedora.yml'
+      # Ubuntu container builder template
+      - '/templates/ubuntu.yml'
 
 stages:
   - prep             # rebuild the container images if there is a change
index fa0a91ccbf2b2dfd391af11349404f23536cba53..c3e854b5203f39f604d2155ff33d516485c2d3a4 100644 (file)
@@ -9,11 +9,12 @@
 .templates_sha: &template_sha 0c312d9c7255f46e741d43bcd1930f09cd12efe7 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
 
 include:
-  {% for distribution in distributions|map(attribute='name')|unique()|sort() %}
-  # {{ distribution.capitalize() }} container builder template
   - project: 'freedesktop/ci-templates'
     ref: *template_sha
-    file: '/templates/{{distribution}}.yml'
+    file:
+  {% for distribution in distributions|map(attribute='name')|unique()|sort() %}
+      # {{ distribution.capitalize() }} container builder template
+      - '/templates/{{distribution}}.yml'
   {% endfor %}
 
 stages: