From a08a6a970148536ea4669567a19ab1a4c583d652 Mon Sep 17 00:00:00 2001
From: Tim Jaacks <tim.jaacks@seco.com>
Date: Tue, 18 Jul 2023 16:00:27 +0200
Subject: [PATCH] Make distro and image combos dynamic

---
 manifest-pipeline-yocto.yml | 23 ++++++++++++-----------
 manifest-pipeline.yml       |  4 ++--
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/manifest-pipeline-yocto.yml b/manifest-pipeline-yocto.yml
index a3fad6c1..9473f1cd 100644
--- a/manifest-pipeline-yocto.yml
+++ b/manifest-pipeline-yocto.yml
@@ -28,16 +28,17 @@ variables:
 
 generate-build-jobs:
   variables:
-    # Default image and distro
-    CI_PARAM_IMAGE: guf-image
-    CI_PARAM_DISTRO: guf-wayland
-
-    # Flash-N-Go image and distro
-    # In the past, the buildfng job overwrote the image and distro itself. Due to the
-    # transition to the new seconorth names, image and distro for the buildfng must be
-    # settable from outside of the job.
-    CI_PARAM_IMAGE_FNG: fngsystem-image
-    CI_PARAM_DISTRO_FNG: guf-fngsystem
-
     # List of machines to build images for
     CI_PARAM_MACHINES: imx6guf imx6ullguf imx8mguf imx8mpguf
+  parallel:
+    matrix: &build_jobs
+      # Default image and distro
+      - CI_PARAM_IMAGE: guf-image
+        CI_PARAM_DISTRO: guf-wayland
+      # Flash-N-Go image and distro
+      - CI_PARAM_IMAGE: fngsystem-image
+        CI_PARAM_DISTRO: guf-fngsystem
+
+build-jobs:
+  parallel:
+    matrix: *build_jobs
diff --git a/manifest-pipeline.yml b/manifest-pipeline.yml
index 88f79343..baeb2796 100644
--- a/manifest-pipeline.yml
+++ b/manifest-pipeline.yml
@@ -70,7 +70,7 @@ generate-build-jobs:
     # to explicitly pass any of them as command line arguments.
     - .gitlab-ci/scripts/generate_job_from_template.py
               --template=.gitlab-ci/${BUILD_JOBS_TEMPLATE}
-              > build-jobs.yml
+              > build-jobs-${CI_PARAM_DISTRO}-${CI_PARAM_IMAGE}.yml
   artifacts:
     expire_in: 4 weeks
     paths:
@@ -82,7 +82,7 @@ build-jobs:
   needs: ["generate-build-jobs"]
   trigger:
     include:
-      - artifact: build-jobs.yml
+      - artifact: build-jobs-${CI_PARAM_DISTRO}-${CI_PARAM_IMAGE}.yml
         job: generate-build-jobs
     strategy: depend
 
-- 
GitLab