mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-06-10 10:45:55 +00:00
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.
41 lines
1.3 KiB
YAML
41 lines
1.3 KiB
YAML
---
|
|
parameters:
|
|
- name: job_name_suffix
|
|
type: string
|
|
- name: container_name
|
|
type: string
|
|
- name: build_scenario_name
|
|
type: string
|
|
- name: python_version
|
|
type: string
|
|
default: 3.x
|
|
|
|
jobs:
|
|
- job: BuildTestImage${{ parameters.job_name_suffix }}
|
|
displayName: Build ${{ parameters.container_name }} test container
|
|
steps:
|
|
- task: UsePythonVersion@0
|
|
inputs:
|
|
versionSpec: '${{ parameters.python_version }}'
|
|
|
|
- script: python -m pip install --upgrade pip setuptools wheel ansible
|
|
displayName: Install tools
|
|
|
|
- script: pip install molecule[docker]
|
|
displayName: Install molecule
|
|
|
|
- script: molecule create -s ${{ parameters.build_scenario_name }}
|
|
displayName: Create test container
|
|
env:
|
|
ANSIBLE_LIBRARY: ./molecule
|
|
|
|
- script: |
|
|
docker stop ${{ parameters.build_scenario_name }}
|
|
docker commit ${{ parameters.build_scenario_name }} quay.io/ansible-freeipa/upstream-tests:${{ parameters.container_name }}
|
|
docker login -u="$QUAY_ROBOT_USERNAME" -p="$QUAY_ROBOT_TOKEN" quay.io
|
|
docker push quay.io/ansible-freeipa/upstream-tests:${{ parameters.container_name }}
|
|
displayName: Save image and upload
|
|
env:
|
|
# Secrets needs to be mapped as env vars to work properly
|
|
QUAY_ROBOT_TOKEN: $(QUAY_ROBOT_TOKEN)
|