Added Azure pipelines to build test containers

Added a pipeline file (tests/azure/build-containers.yml) to build test
containers and upload them to quay.io. The pipeline will create
containers with IPA pre-installed for testing proposes on three
different Linux containers: CentOS 7, CentOS 8 and Fedora Latest.
This commit is contained in:
Sergio Oliveira Campos
2020-08-17 16:10:23 -03:00
parent 9a97303cca
commit b4fbfadeec
12 changed files with 165 additions and 37 deletions

View File

@@ -0,0 +1,35 @@
parameters:
- name: job_name_suffix
type: string
- name: container_name
type: string
- name: build_scenario_name
type: string
jobs:
- job: BuildTestImage${{ parameters.job_name_suffix }}
displayName: Build ${{ parameters.container_name }} test container
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6'
- script: python -m pip install --upgrade pip setuptools wheel
displayName: Install tools
- script: pip install molecule[docker]
displayName: Install molecule
- script: molecule create -s ${{ parameters.build_scenario_name }}
displayName: Create test container
- 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)