From ff31d083da0a1db32df8832dc871378b7814a008 Mon Sep 17 00:00:00 2001 From: Tim Jaacks <tim.jaacks@seco.com> Date: Fri, 13 Oct 2023 14:13:19 +0200 Subject: [PATCH] Refactoring: use multiple MACHINE loops for better structure This is a preparation for adding dedicated documentation jobs. In order to have these grouped by stage along with their corresponding machine jobs, we have to get rid of the giant outer loop and add loops for each stage instead. --- build-pipeline-yocto.yml.jinja2 | 41 ++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/build-pipeline-yocto.yml.jinja2 b/build-pipeline-yocto.yml.jinja2 index e23ed53b..cf38becd 100644 --- a/build-pipeline-yocto.yml.jinja2 +++ b/build-pipeline-yocto.yml.jinja2 @@ -40,15 +40,12 @@ build-version: # so we just choose the first. MACHINE: {{ MACHINES.split(' ')[0] }} -# -------------------------------------------------------------------------------------- -# Generated jobs -# -------------------------------------------------------------------------------------- -{% if MACHINES %} -{% for machine in MACHINES.split(' ') %} # -------------------------------------------------------------------------------------- # Stage: Build # -------------------------------------------------------------------------------------- +{% for machine in MACHINES.split(' ') %} + {% if SIMULATE_BUILD is not defined or SIMULATE_BUILD != "true" %} build-{{ machine }}: @@ -84,12 +81,16 @@ build-{{ machine }}: {% endif %} +{% endfor %} + + # -------------------------------------------------------------------------------------- # Stage: Test # -------------------------------------------------------------------------------------- # Run platform tests for this machine which the yocto image # This is a little hacky as we need to match the machine name to # the available platforms +{% for machine in MACHINES.split(' ') %} {% if machine == 'seco-mx6' or machine == 'imx6guf' %} {% set platforms = "santaro santoka santino santino-lt" %} @@ -132,10 +133,14 @@ platformtest:{{ machine }}: PLATFORMS: {{ platforms }} {% endif %} +{% endfor %} + # -------------------------------------------------------------------------------------- # Stage: Package # -------------------------------------------------------------------------------------- +{% for machine in MACHINES.split(' ') %} + package-{{ machine }}: extends: .package variables: @@ -148,10 +153,14 @@ package-{{ machine }}: - job: changelog - job: build-version +{% endfor %} + # -------------------------------------------------------------------------------------- # Stage: Deploy SoftwareStore # -------------------------------------------------------------------------------------- +{% for machine in MACHINES.split(' ') %} + deploy-{{ machine }}: extends: .deploy-rsync {% if CI_COMMIT_TAG is defined %} @@ -184,10 +193,14 @@ deploy-{{ machine }}: - job: changelog - job: build-version +{% endfor %} + # -------------------------------------------------------------------------------------- # Stage: Alphaplan # -------------------------------------------------------------------------------------- +{% for machine in MACHINES.split(' ') %} + generate-alphaplan-data-{{ machine }}: extends: .generate_alphaplan_data variables: @@ -201,6 +214,8 @@ import-alphaplan-data-{{ machine }}: needs: - generate-alphaplan-data-{{ machine }} +{% endfor %} + # -------------------------------------------------------------------------------------- # Stage: Deploy FTP @@ -208,6 +223,8 @@ import-alphaplan-data-{{ machine }}: {% if SIMULATE_BUILD is defined and SIMULATE_BUILD == "true" or CI_COMMIT_TAG is defined %} +{% for machine in MACHINES.split(' ') %} + ftp-{{ machine }}: extends: .deploy-rsync stage: Deploy FTP @@ -229,6 +246,8 @@ ftp-{{ machine }}: - job: changelog - job: build-version +{% endfor %} + {% endif %} @@ -238,6 +257,8 @@ ftp-{{ machine }}: {% if SIMULATE_BUILD is defined and SIMULATE_BUILD == "true" or CI_COMMIT_TAG is defined %} +{% for machine in MACHINES.split(' ') %} + azure-{{ machine }}: extends: .deploy-azure stage: Deploy Azure @@ -259,14 +280,10 @@ azure-{{ machine }}: - job: changelog - job: build-version -{% endif %} - - -# -------------------------------------------------------------------------------------- -# End of generated jobs -# -------------------------------------------------------------------------------------- {% endfor %} +{% endif %} + # -------------------------------------------------------------------------------------- # Stage: Confluence @@ -293,5 +310,3 @@ publish-confluence-page: - .confluence-rules {% endif %} - -{% endif %} # if MACHINES -- GitLab