mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-14 13:32:10 +00:00
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:
35
tests/azure/templates/build_container.yml
Normal file
35
tests/azure/templates/build_container.yml
Normal 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)
|
||||
Reference in New Issue
Block a user