mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-06-10 10:45:55 +00:00
Some tasks used to setup Azure environment might fail to temporary errors like timeouts and connection failures. Allowing the tasks to retry a few times will allow the test to be correctly executed rather than returning an error that is not related to the feature tested.
44 lines
1.4 KiB
YAML
44 lines
1.4 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: pip install molecule[docker]
|
|
retryCountOnTaskFailure: 5
|
|
displayName: Install molecule
|
|
|
|
- script: molecule create -s ${{ parameters.build_scenario_name }}
|
|
retryCountOnTaskFailure: 5
|
|
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)
|