upstream CI: Update Python version when building containers.

Newer Ansible versions will require at least Python 3.8 to be used,
and the build containers pipeline was requiring Python 3.6, which is
EOL.

This patch requests the latest Python version available for the
controller, and allows it to be configured to a specific version if,
and when, needed.
This commit is contained in:
Rafael Guterres Jeffman
2022-01-17 09:31:45 -03:00
parent 998a141482
commit c89f6624b5
5 changed files with 57 additions and 53 deletions

View File

@@ -16,3 +16,4 @@ provisioner:
name: ansible name: ansible
playbooks: playbooks:
prepare: ../resources/playbooks/prepare-build.yml prepare: ../resources/playbooks/prepare-build.yml
prerun: false

View File

@@ -40,16 +40,16 @@ stages:
scenario: c8s scenario: c8s
ansible_version: ">=2.9,<2.10" ansible_version: ">=2.9,<2.10"
# CentOS 8 # # CentOS 8
#
- stage: CentOS8_Ansible_2_9 # - stage: CentOS8_Ansible_2_9
dependsOn: [] # dependsOn: []
jobs: # jobs:
- template: templates/group_tests.yml # - template: templates/group_tests.yml
parameters: # parameters:
build_number: $(Build.BuildNumber) # build_number: $(Build.BuildNumber)
scenario: centos-8 # scenario: centos-8
ansible_version: ">=2.9,<2.10" # ansible_version: ">=2.9,<2.10"
# CentOS 7 # CentOS 7

View File

@@ -21,11 +21,11 @@ jobs:
container_name: centos-7 container_name: centos-7
build_scenario_name: centos-7-build build_scenario_name: centos-7-build
- template: templates/build_container.yml # - template: templates/build_container.yml
parameters: # parameters:
job_name_suffix: Centos8 # job_name_suffix: Centos8
container_name: centos-8 # container_name: centos-8
build_scenario_name: centos-8-build # build_scenario_name: centos-8-build
- template: templates/build_container.yml - template: templates/build_container.yml
parameters: parameters:

View File

@@ -119,43 +119,43 @@ stages:
scenario: c8s scenario: c8s
ansible_version: "" ansible_version: ""
# CentOS 8 # # CentOS 8
#
- stage: CentOS8_Ansible_2_9 # - stage: CentOS8_Ansible_2_9
dependsOn: [] # dependsOn: []
jobs: # jobs:
- template: templates/group_tests.yml # - template: templates/group_tests.yml
parameters: # parameters:
build_number: $(Build.BuildNumber) # build_number: $(Build.BuildNumber)
scenario: centos-8 # scenario: centos-8
ansible_version: ">=2.9,<2.10" # ansible_version: ">=2.9,<2.10"
#
- stage: CentOS8_Ansible_Core_2_11 # - stage: CentOS8_Ansible_Core_2_11
dependsOn: [] # dependsOn: []
jobs: # jobs:
- template: templates/group_tests.yml # - template: templates/group_tests.yml
parameters: # parameters:
build_number: $(Build.BuildNumber) # build_number: $(Build.BuildNumber)
scenario: centos-8 # scenario: centos-8
ansible_version: "-core >=2.11,<2.12" # ansible_version: "-core >=2.11,<2.12"
#
- stage: CentOS8_Ansible_Core_2_12 # - stage: CentOS8_Ansible_Core_2_12
dependsOn: [] # dependsOn: []
jobs: # jobs:
- template: templates/group_tests.yml # - template: templates/group_tests.yml
parameters: # parameters:
build_number: $(Build.BuildNumber) # build_number: $(Build.BuildNumber)
scenario: centos-8 # scenario: centos-8
ansible_version: "-core >=2.12,<2.13" # ansible_version: "-core >=2.12,<2.13"
#
- stage: CentOS8_Ansible_latest # - stage: CentOS8_Ansible_latest
dependsOn: [] # dependsOn: []
jobs: # jobs:
- template: templates/group_tests.yml # - template: templates/group_tests.yml
parameters: # parameters:
build_number: $(Build.BuildNumber) # build_number: $(Build.BuildNumber)
scenario: centos-8 # scenario: centos-8
ansible_version: "" # ansible_version: ""
# CentOS 7 # CentOS 7

View File

@@ -6,6 +6,9 @@ parameters:
type: string type: string
- name: build_scenario_name - name: build_scenario_name
type: string type: string
- name: python_version
type: string
default: 3.x
jobs: jobs:
- job: BuildTestImage${{ parameters.job_name_suffix }} - job: BuildTestImage${{ parameters.job_name_suffix }}
@@ -13,7 +16,7 @@ jobs:
steps: steps:
- task: UsePythonVersion@0 - task: UsePythonVersion@0
inputs: inputs:
versionSpec: '3.6' versionSpec: '${{ parameters.python_version }}'
- script: python -m pip install --upgrade pip setuptools wheel ansible - script: python -m pip install --upgrade pip setuptools wheel ansible
displayName: Install tools displayName: Install tools