upstream CI: Use Azure 'loops' to create stages

This patch modify the pipelines to create stages using the 'each'
expression on Azure pipelines, so that the configuration and the list of
distributions can be set using variables.

Testing CentOS 8 Stream and Galaxy collections still need to be handled
in a separate group, although, the pipeline configuration becomes easily
changed, specially when updating Ansible versions.
This commit is contained in:
Rafael Guterres Jeffman
2024-10-31 09:23:30 -03:00
parent cb3226910b
commit 3e405fd08d
5 changed files with 112 additions and 222 deletions

View File

@@ -1,5 +1,4 @@
---
schedules:
- cron: "0 0 * * 0"
displayName: Weekly Sunday midnight build
@@ -13,46 +12,24 @@ trigger: none
pool:
vmImage: 'ubuntu-24.04'
variables: { distros: "fedora-latest,fedora-rawhide,c9s" }
stages:
- ${{ each distro in split(variables.distros, ',') }}:
- stage: build_${{ join('_', split(distro, '-')) }}
dependsOn: []
jobs:
- template: templates/build_container.yml
parameters:
distro: ${{ distro }}
# Special case for CentOS 8 Stream
- stage: CentOS_8_Stream
dependsOn: []
jobs:
- template: templates/build_container.yml
parameters:
job_name_suffix: C8S
distro: c8s
# ansible-core 2.17+ cannot be used to deploy on CentOS 8 Stream.
ansible_core_version: "<2.17"
- stage: CentOS_9_Stream
dependsOn: []
jobs:
- template: templates/build_container.yml
parameters:
job_name_suffix: C9S
distro: c9s
- stage: CentOS_10_Stream
dependsOn: []
jobs:
- template: templates/build_container.yml
parameters:
job_name_suffix: C10S
distro: c10s
- stage: Fedora_Latest
dependsOn: []
jobs:
- template: templates/build_container.yml
parameters:
job_name_suffix: FedoraLatest
distro: fedora-latest
- stage: Fedora_Rawhide
dependsOn: []
jobs:
- template: templates/build_container.yml
parameters:
job_name_suffix: FedoraRawhide
distro: fedora-rawhide