Skip to content

Commit 2dee8f7

Browse files
authored
Merge pull request #1 from redhat-cop/subscription-manager-manage
subscription-manager Management and update on GH action to not run semantic release on other branches.
2 parents 65e8c91 + 3204b3a commit 2dee8f7

6 files changed

Lines changed: 36 additions & 31 deletions

File tree

.github/workflows/build-ee.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,14 @@ jobs:
103103
# steps:
104104
# - uses: actions/checkout@v4
105105
# with:
106-
# fetch-depth: 0
106+
# fetch-depth: 0
107107
# - name: Python Semantic Release
108108
# uses: python-semantic-release/python-semantic-release@v9.15.0
109109
# with:
110110
# github_token: ${{ secrets.GITHUB_TOKEN }}
111111
release:
112112
needs: build-and-push
113+
if: github.ref == 'refs/heads/main'
113114
runs-on: ubuntu-latest
114115
concurrency:
115116
group: ${{ github.workflow }}-release-${{ github.ref_name }}
@@ -126,9 +127,9 @@ jobs:
126127
# while the workflow was running, which prevents accidentally releasing un-evaluated
127128
# changes.
128129
- name: Setup | Checkout Repository on Release Branch
129-
uses: actions/checkout@v4
130+
uses: actions/checkout@v6
130131
with:
131-
ref: ${{ github.ref_name }}
132+
fetch-depth: 0
132133

133134
- name: Setup | Force release branch to be at workflow sha
134135
run: |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# System dependencies for building EEs
2+
gcc [platform:rpm]
3+
systemd-devel [platform:rpm]
4+
python3.12-devel [platform:rpm]

openshift-virtualization-migration-ee-2.4/execution-environment.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ images:
66
options:
77
package_manager_path: /usr/bin/microdnf
88
dependencies:
9+
system: bindep.txt
10+
python_interpreter:
11+
package_system: python3.12
12+
python_path: /usr/bin/python3.12
913
ansible_core:
10-
package_pip: ansible-core>=2.15.0rc2,<2.16
14+
package_pip: ansible-core>=2.16
1115
ansible_runner:
1216
package_pip: ansible-runner
1317
galaxy: requirements.yml
@@ -17,16 +21,14 @@ additional_build_steps:
1721
prepend_base:
1822
- ARG REDHAT_ORG
1923
- ARG REDHAT_ACTIVATION_KEY
20-
# FIX 1: Install subscription-manager AND python3-pip
21-
- RUN microdnf install -y subscription-manager python3-pip
22-
- RUN subscription-manager register --org $REDHAT_ORG --activationkey $REDHAT_ACTIVATION_KEY
23-
- RUN $PKGMGR -y remove python3-typing-extensions python3-black python3-jsonschema ansible-lint || true
24-
- RUN $PYCMD -m pip install -U pip setuptools
25-
26-
# FIX 2: Restore repo enablement so packages can be found
24+
- RUN if [[ ! -z "$REDHAT_ORG" ]] && [[ ! -z "$REDHAT_ACTIVATION_KEY" ]]; then microdnf install -y subscription-manager && subscription-manager register --org $REDHAT_ORG --activationkey $REDHAT_ACTIVATION_KEY; else echo "Skipping Subscribing Build"; fi
25+
# The fix for rpds-py is included here:
26+
- RUN $PKGMGR -y remove python3.12-typing-extensions python3.12-referencing python3.12-jsonschema python3.12-rpds-py python3.12-ansible-compat python3.12-jsonschema-specifications ansible-lint || true
27+
- RUN $PYCMD -m pip install --upgrade pip setuptools
28+
2729
prepend_builder:
28-
- ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-4.17-for-rhel-9-*-rpms"
29-
30+
- ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-4.21-for-rhel-9-*-rpms"
31+
3032
prepend_galaxy:
3133
- ARG ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_VALIDATED_URL
3234
- ARG ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_VALIDATED_AUTH_URL
@@ -37,12 +39,10 @@ additional_build_steps:
3739
- ARG ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_CERTIFIED_TOKEN
3840
- ARG ANSIBLE_GALAXY_SERVER_UPSTREAM_GALAXY_URL
3941
- ARG ANSIBLE_GALAXY_SERVER_LIST
40-
41-
# FIX 3: Restore repo enablement for the final stage
42+
4243
prepend_final:
43-
- ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-4.17-for-rhel-9-*-rpms"
44-
45-
append_base:
46-
- RUN $PYCMD -m pip install -U pip
44+
- ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-4.21-for-rhel-9-*-rpms"
45+
4746
append_final:
48-
- RUN subscription-manager unregister
47+
- RUN ln -sf /usr/bin/python3.12 /usr/bin/python3
48+
- RUN if [[ ! -z "$REDHAT_ORG" ]] && [[ ! -z "$REDHAT_ACTIVATION_KEY" ]]; then subscription-manager unregister || true; else echo "Skipping Unregistering Build"; fi

openshift-virtualization-migration-ee-2.4/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ omsdk >= 1.2.490
22
kubernetes >= 12.0.0
33
PyYAML >= 3.11
44
aiohttp
5-
jsonpatch
5+
jmespath
6+
jsonpatch
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# System dependencies for building EEs
22
gcc [platform:rpm]
33
systemd-devel [platform:rpm]
4-
python3.11-devel [platform:rpm]
4+
python3.12-devel [platform:rpm]

openshift-virtualization-migration-ee-2.5/execution-environment.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ options:
88
dependencies:
99
system: bindep.txt
1010
python_interpreter:
11-
package_system: python3.11
12-
python_path: /usr/bin/python3.11
11+
package_system: python3.12
12+
python_path: /usr/bin/python3.12
1313
ansible_core:
1414
package_pip: ansible-core>=2.16
1515
ansible_runner:
@@ -21,14 +21,13 @@ additional_build_steps:
2121
prepend_base:
2222
- ARG REDHAT_ORG
2323
- ARG REDHAT_ACTIVATION_KEY
24-
- RUN microdnf install -y subscription-manager
25-
- RUN subscription-manager register --org $REDHAT_ORG --activationkey $REDHAT_ACTIVATION_KEY
24+
- RUN if [[ ! -z "$REDHAT_ORG" ]] && [[ ! -z "$REDHAT_ACTIVATION_KEY" ]]; then microdnf install -y subscription-manager && subscription-manager register --org $REDHAT_ORG --activationkey $REDHAT_ACTIVATION_KEY; else echo "Skipping Subscribing Build"; fi
2625
# The fix for rpds-py is included here:
27-
- RUN $PKGMGR -y remove python3.11-typing-extensions python3.11-referencing python3.11-jsonschema python3.11-rpds-py python3.11-ansible-compat python3.11-jsonschema-specifications ansible-lint || true
26+
- RUN $PKGMGR -y remove python3.12-typing-extensions python3.12-referencing python3.12-jsonschema python3.12-rpds-py python3.12-ansible-compat python3.12-jsonschema-specifications ansible-lint || true
2827
- RUN $PYCMD -m pip install --upgrade pip setuptools
2928

3029
prepend_builder:
31-
- ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-4.17-for-rhel-9-*-rpms"
30+
- ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-4.21-for-rhel-9-*-rpms"
3231

3332
prepend_galaxy:
3433
- ARG ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_VALIDATED_URL
@@ -42,8 +41,8 @@ additional_build_steps:
4241
- ARG ANSIBLE_GALAXY_SERVER_LIST
4342

4443
prepend_final:
45-
- ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-4.17-for-rhel-9-*-rpms"
44+
- ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-4.21-for-rhel-9-*-rpms"
4645

4746
append_final:
48-
- RUN ln -sf /usr/bin/python3.11 /usr/bin/python3
49-
- RUN subscription-manager unregister || true
47+
- RUN ln -sf /usr/bin/python3.12 /usr/bin/python3
48+
- RUN if [[ ! -z "$REDHAT_ORG" ]] && [[ ! -z "$REDHAT_ACTIVATION_KEY" ]]; then subscription-manager unregister || true; else echo "Skipping Unregistering Build"; fi

0 commit comments

Comments
 (0)