build containers: Allow setting of Python version used.

Currently the pipeline used to create test containers is using Python
3.6.15, and Ansible 2.12 requires, at least, Python 3.8.

This change adds a new parameter to build container template,
`python_version`, which is set by default to '3.x', meaning it will use
the latest Python version available (for version 3) if the parameter is
not explicitly set.
This commit is contained in:
Rafael Guterres Jeffman
2022-02-15 09:12:26 -03:00
parent 1b74cf1692
commit 3c130795e3

View File

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