From 4ff9d28d3c00e84f7a2869a765c7d75c838855f8 Mon Sep 17 00:00:00 2001 From: Sebastian Rodriguez Isaziga Date: Mon, 4 May 2026 19:40:43 +0200 Subject: [PATCH] feat: parameterise hardcoded OCP version in EE build configuration Replace hardcoded rhocp-4.21 repo name with an OCP_VERSION build-arg (defaulting to 4.21) across all three EE versions. This eliminates the need to edit 6 locations across 3 files when updating the OCP dependency. Changes: - All EE versions: added ARG OCP_VERSION=4.21 to prepend_builder and prepend_final steps, replacing literal rhocp-4.21 in PKGMGR_OPTS - build-ee.yml: pass OCP_VERSION=4.21 as an explicit build-arg so the value is visible and overridable from CI Closes #9 --- .github/workflows/build-ee.yml | 1 + .../execution-environment.yml | 6 ++++-- .../execution-environment.yml | 6 ++++-- .../execution-environment.yml | 6 ++++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-ee.yml b/.github/workflows/build-ee.yml index 29d3f74..692a204 100644 --- a/.github/workflows/build-ee.yml +++ b/.github/workflows/build-ee.yml @@ -72,6 +72,7 @@ jobs: openshift-virtualization-migration-ee-${{ matrix.aap_version }}/context/Containerfile platforms: linux/amd64,linux/arm64 build-args: | + OCP_VERSION=4.21 REDHAT_ORG=${{ secrets.REDHAT_ORG }} REDHAT_ACTIVATION_KEY=${{ secrets.REDHAT_ACTIVATION_KEY }} ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_VALIDATED_TOKEN=${{ secrets.AH_TOKEN_VALIDATED }} diff --git a/openshift-virtualization-migration-ee-2.4/execution-environment.yml b/openshift-virtualization-migration-ee-2.4/execution-environment.yml index 4d739db..cae3428 100644 --- a/openshift-virtualization-migration-ee-2.4/execution-environment.yml +++ b/openshift-virtualization-migration-ee-2.4/execution-environment.yml @@ -27,7 +27,8 @@ additional_build_steps: - RUN $PYCMD -m pip install --upgrade pip setuptools prepend_builder: - - ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-4.21-for-rhel-9-*-rpms" + - ARG OCP_VERSION=4.21 + - ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-${OCP_VERSION}-for-rhel-9-*-rpms" prepend_galaxy: - ARG ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_VALIDATED_URL @@ -41,7 +42,8 @@ additional_build_steps: - ARG ANSIBLE_GALAXY_SERVER_LIST prepend_final: - - ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-4.21-for-rhel-9-*-rpms" + - ARG OCP_VERSION=4.21 + - ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-${OCP_VERSION}-for-rhel-9-*-rpms" append_final: - RUN ln -sf /usr/bin/python3.12 /usr/bin/python3 diff --git a/openshift-virtualization-migration-ee-2.5/execution-environment.yml b/openshift-virtualization-migration-ee-2.5/execution-environment.yml index 41cec2b..fde627d 100644 --- a/openshift-virtualization-migration-ee-2.5/execution-environment.yml +++ b/openshift-virtualization-migration-ee-2.5/execution-environment.yml @@ -27,7 +27,8 @@ additional_build_steps: - RUN $PYCMD -m pip install --upgrade pip setuptools prepend_builder: - - ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-4.21-for-rhel-9-*-rpms" + - ARG OCP_VERSION=4.21 + - ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-${OCP_VERSION}-for-rhel-9-*-rpms" prepend_galaxy: - ARG ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_VALIDATED_URL @@ -41,7 +42,8 @@ additional_build_steps: - ARG ANSIBLE_GALAXY_SERVER_LIST prepend_final: - - ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-4.21-for-rhel-9-*-rpms" + - ARG OCP_VERSION=4.21 + - ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-${OCP_VERSION}-for-rhel-9-*-rpms" append_final: - RUN ln -sf /usr/bin/python3.12 /usr/bin/python3 diff --git a/openshift-virtualization-migration-ee-2.6/execution-environment.yml b/openshift-virtualization-migration-ee-2.6/execution-environment.yml index f024e7e..cee7d57 100644 --- a/openshift-virtualization-migration-ee-2.6/execution-environment.yml +++ b/openshift-virtualization-migration-ee-2.6/execution-environment.yml @@ -27,7 +27,8 @@ additional_build_steps: - RUN $PYCMD -m pip install --upgrade pip setuptools prepend_builder: - - ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-4.21-for-rhel-9-*-rpms" + - ARG OCP_VERSION=4.21 + - ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-${OCP_VERSION}-for-rhel-9-*-rpms" prepend_galaxy: - ARG ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_VALIDATED_URL @@ -41,7 +42,8 @@ additional_build_steps: - ARG ANSIBLE_GALAXY_SERVER_LIST prepend_final: - - ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-4.21-for-rhel-9-*-rpms" + - ARG OCP_VERSION=4.21 + - ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-${OCP_VERSION}-for-rhel-9-*-rpms" append_final: - RUN ln -sf /usr/bin/python3.12 /usr/bin/python3