Skip to content
Snippets Groups Projects
Commit 928ed30b authored by Rafael Guterres Jeffman's avatar Rafael Guterres Jeffman Committed by Thomas Woerner
Browse files

ustream ci: Use infra scripts to build testing images

As we do not use molecule features, using a Dockerfile and the
ansible-freeipa deployment roles is enough to create the container
testing images.

This patch removes the usage of molecule in favor of the custom
ansible-freeipa image building script, which allow us to have a similar
process for creating images both on the ustream CI, or on a developer's
environment.

Also, CentOS 7 is removed from the build script, as it in not possible
to run CentOS 7 containers with current versions of systemd.
parent fb6fed58
No related branches found
No related tags found
No related merge requests found
...@@ -11,18 +11,19 @@ schedules: ...@@ -11,18 +11,19 @@ schedules:
trigger: none trigger: none
pool: pool:
vmImage: 'ubuntu-20.04' vmImage: 'ubuntu-22.04'
stages: stages:
- stage: CentOS_7 # Currently, it's not possible to use CentOS container
dependsOn: [] #
jobs: # - stage: CentOS_7
- template: templates/build_container.yml # dependsOn: []
parameters: # jobs:
job_name_suffix: Centos7 # - template: templates/build_container.yml
container_name: centos-7 # parameters:
build_scenario_name: centos-7-build # job_name_suffix: Centos7
# distro: centos-7
- stage: CentOS_8_Stream - stage: CentOS_8_Stream
dependsOn: [] dependsOn: []
...@@ -30,8 +31,9 @@ stages: ...@@ -30,8 +31,9 @@ stages:
- template: templates/build_container.yml - template: templates/build_container.yml
parameters: parameters:
job_name_suffix: C8S job_name_suffix: C8S
container_name: c8s distro: c8s
build_scenario_name: c8s-build # ansible-core 2.17+ cannot be used to deploy on CentOS 8 Stream.
ansible_core_version: "<2.17"
- stage: CentOS_9_Stream - stage: CentOS_9_Stream
dependsOn: [] dependsOn: []
...@@ -39,8 +41,7 @@ stages: ...@@ -39,8 +41,7 @@ stages:
- template: templates/build_container.yml - template: templates/build_container.yml
parameters: parameters:
job_name_suffix: C9S job_name_suffix: C9S
container_name: c9s distro: c9s
build_scenario_name: c9s-build
- stage: Fedora_Latest - stage: Fedora_Latest
dependsOn: [] dependsOn: []
...@@ -48,8 +49,7 @@ stages: ...@@ -48,8 +49,7 @@ stages:
- template: templates/build_container.yml - template: templates/build_container.yml
parameters: parameters:
job_name_suffix: FedoraLatest job_name_suffix: FedoraLatest
container_name: fedora-latest distro: fedora-latest
build_scenario_name: fedora-latest-build
- stage: Fedora_Rawhide - stage: Fedora_Rawhide
dependsOn: [] dependsOn: []
...@@ -57,5 +57,4 @@ stages: ...@@ -57,5 +57,4 @@ stages:
- template: templates/build_container.yml - template: templates/build_container.yml
parameters: parameters:
job_name_suffix: FedoraRawhide job_name_suffix: FedoraRawhide
container_name: fedora-rawhide distro: fedora-rawhide
build_scenario_name: fedora-rawhide-build
...@@ -2,38 +2,49 @@ ...@@ -2,38 +2,49 @@
parameters: parameters:
- name: job_name_suffix - name: job_name_suffix
type: string type: string
- name: container_name - name: distro
type: string
- name: build_scenario_name
type: string type: string
- name: python_version - name: python_version
type: string type: string
default: 3.x default: 3.x
- name: ansible_core_version
default: ""
jobs: jobs:
- job: BuildTestImage${{ parameters.job_name_suffix }} - job: BuildTestImage${{ parameters.job_name_suffix }}
displayName: Build ${{ parameters.container_name }} test container displayName: Build ${{ parameters.distro }} test container
steps: steps:
- task: UsePythonVersion@0 - task: UsePythonVersion@0
inputs: inputs:
versionSpec: '${{ parameters.python_version }}' versionSpec: '${{ parameters.python_version }}'
- script: python -m pip install --upgrade pip setuptools wheel ansible - script: python -m pip install --upgrade pip "ansible-core${{ parameters.ansible_core_version }}"
retryCountOnTaskFailure: 5 retryCountOnTaskFailure: 5
displayName: Install tools displayName: Install tools
- script: |
rm -rf ~/.ansible
mkdir -p ~/.ansible
ln -snf $(readlink -f roles) ~/.ansible/roles
ln -snf $(readlink -f plugins) ~/.ansible/plugins
displayName: Setup ansible-freeipa using Git repository
- script: ansible-galaxy collection install containers.podman - script: ansible-galaxy collection install containers.podman
retryCountOnTaskFailure: 5 displayName: Install Ansible Galaxy collections
displayName: Install Ansible collections
- script: infra/image/build.sh ${{ parameters.build_scenario_name }} - script: infra/image/build.sh -s ${{ parameters.distro }}
retryCountOnTaskFailure: 5 displayName: Build ${{ parameters.distro }} base image
displayName: Create test container
- script: | - script: podman login -u="$QUAY_ROBOT_USERNAME" -p="$QUAY_ROBOT_TOKEN" quay.io
podman login -u="$QUAY_ROBOT_USERNAME" -p="$QUAY_ROBOT_TOKEN" quay.io displayName: Registry login
podman push quay.io/ansible-freeipa/upstream-tests:${{ parameters.container_name }}
displayName: Save image and upload
env: env:
# Secrets needs to be mapped as env vars to work properly # Secrets needs to be mapped as env vars to work properly
QUAY_ROBOT_TOKEN: $(QUAY_ROBOT_TOKEN) QUAY_ROBOT_TOKEN: $(QUAY_ROBOT_TOKEN)
- script: |
podman push ${{parameters.distro}}-base quay.io/ansible-freeipa/upstream-tests:${{ parameters.distro }}-base
displayName: Push base image
- script: |
podman push ${{ parameters.distro }}-server quay.io/ansible-freeipa/upstream-tests:${{ parameters.distro }}-server
displayName: Push server image
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment