From bf72012921019faba9f416e3baeb9200692e93ee Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 27 Feb 2020 15:56:29 +1000 Subject: [PATCH] gitlab CI: group the config by distribution type No functional changes, this produces the same gitlab CI file Signed-off-by: Peter Hutterer --- .gitlab-ci/gitlab-ci-config.yaml | 35 ++++++++++++++++------------------- .gitlab-ci/gitlab-ci.tmpl | 30 ++++++++++++++++++------------ 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/.gitlab-ci/gitlab-ci-config.yaml b/.gitlab-ci/gitlab-ci-config.yaml index 3f43103..2e460b9 100644 --- a/.gitlab-ci/gitlab-ci-config.yaml +++ b/.gitlab-ci/gitlab-ci-config.yaml @@ -3,32 +3,29 @@ distributions: - name: fedora - version: '30' - - name: fedora - version: '31' - - name: ubuntu - version: '19.10' + versions: + - '30' + - '31' - name: ubuntu - version: '19.04' - - name: debian - version: 'stable' + versions: + - '19.10' + - '19.04' - name: debian - version: 'sid' - - name: centos - version: 7 - build: - meson: False - extra_variables: - # note: the variable value includes the comment because we want that in the gitlab-ci file - MAKE_ARGS: "'' # disable distcheck, requires doxygen" + versions: + - 'stable' + - 'sid' - name: centos - version: 8 + versions: + - '7' + - '8' build: meson: False extra_variables: # note: the variable value includes the comment because we want that in the gitlab-ci file MAKE_ARGS: "'' # disable distcheck, requires doxygen" - name: arch - version: 'rolling' + versions: + - 'rolling' - name: alpine - version: 'latest' + versions: + - 'latest' diff --git a/.gitlab-ci/gitlab-ci.tmpl b/.gitlab-ci/gitlab-ci.tmpl index 8767529..290f981 100644 --- a/.gitlab-ci/gitlab-ci.tmpl +++ b/.gitlab-ci/gitlab-ci.tmpl @@ -178,21 +178,23 @@ fedora:31@qemu-prep: allow_failure: true {% for distro in distributions %} +{% for version in distro.versions %} -### {{ distro.name }} {{ distro.version }} -{{ distro.name }}:{{ distro.version }}@container-prep: +### {{ distro.name }} {{ version }} +{{ distro.name }}:{{ version }}@container-prep: extends: - .{{ distro.name }}@container-build - .pull_upstream_or_rebuild stage: prep variables: GIT_STRATEGY: none - {{ distro.name.upper() }}_VERSION: '{{ distro.version }}' + {{ distro.name.upper() }}_VERSION: '{{ version }}' DISTRIB_NAME: {{ distro.name }} DISTRIB_VERSION: ${{ distro.name.upper() }}_VERSION TAG: ${{ distro.name.upper() }}_TAG {% endfor %} +{% endfor %} ################################################################# # # @@ -277,15 +279,17 @@ fedora:31@qemu-prep: GIT_STRATEGY: none {% for distro in distributions %} +{% for version in distro.versions %} -### {{ distro.name }} {{ distro.version }} -{{ distro.name }}:{{ distro.version }}@container-clean: +### {{ distro.name }} {{ version }} +{{ distro.name }}:{{ version }}@container-clean: extends: .container-clean variables: - {{ distro.name.upper() }}_VERSION: '{{ distro.version }}' + {{ distro.name.upper() }}_VERSION: '{{ version }}' CURRENT_CONTAINER_IMAGE: ${{ distro.name.upper() }}_CONTAINER_IMAGE {% endfor %} +{% endfor %} ################################################################# # # @@ -310,38 +314,40 @@ fedora:31@qemu-prep: NINJA_ARGS: "dist" {% for distro in distributions %} +{% for version in distro.versions %} -{{ distro.name }}:{{ distro.version }}@autotools-build: +{{ distro.name }}:{{ version }}@autotools-build: extends: .autotools-build@template stage: autotools image: ${{ distro.name.upper() }}_CONTAINER_IMAGE variables: - {{ distro.name.upper() }}_VERSION: '{{ distro.version }}' + {{ distro.name.upper() }}_VERSION: '{{ version }}' {# Where we have extra_variables defined, add them to the list #} {% if distro.build is defined and distro.build.extra_variables is defined %} {% for key, value in distro.build.extra_variables.items() %} {{ key }}: {{ value }} {% endfor %} {% endif %} - needs: ['{{ distro.name }}:{{ distro.version }}@container-prep'] + needs: ['{{ distro.name }}:{{ version }}@container-prep'] {% if not distro.build is defined or distro.build.meson|default(True) %} -{{ distro.name }}:{{ distro.version }}@meson-build: +{{ distro.name }}:{{ version }}@meson-build: extends: .meson-build@template stage: meson image: ${{ distro.name.upper() }}_CONTAINER_IMAGE variables: - {{ distro.name.upper() }}_VERSION: '{{ distro.version }}' + {{ distro.name.upper() }}_VERSION: '{{ version }}' {# Where we have extra_variables defined, add them to the list #} {% if distro.build is defined and distro.build.extra_variables is defined %} {% for key, value in distro.build.extra_variables.items() %} {{ key }}: {{ value }} {% endfor %} {% endif %} - needs: ['{{ distro.name }}:{{ distro.version }}@container-prep'] + needs: ['{{ distro.name }}:{{ version }}@container-prep'] {% endif %} {% endfor %} +{% endfor %} # Build argument tests # -- 2.7.4