Files
ansible-freeipa/tests/azure/templates/build_container.yml
Thomas Woerner 7ac0ec6bd4 tests/azure/templates/build_container.yml: Use new image builder
The new infra/image/build.sh script is used instead of molecule.
2024-07-31 16:10:02 +02:00

40 lines
1.2 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
retryCountOnTaskFailure: 5
displayName: Install tools
- script: ansible-galaxy collection install containers.podman
retryCountOnTaskFailure: 5
displayName: Install Ansible collections
- script: infra/image/build.sh ${{ parameters.build_scenario_name }}
retryCountOnTaskFailure: 5
displayName: Create test container
- script: |
podman login -u="$QUAY_ROBOT_USERNAME" -p="$QUAY_ROBOT_TOKEN" quay.io
podman 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)