From f87027ecfea0d28a4e65d919fcdc4cfcf67c95b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= Date: Wed, 28 Aug 2024 11:08:29 +0200 Subject: [PATCH] extensions: Only setup repos on SCOS 9 for now --- extensions/Dockerfile | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/extensions/Dockerfile b/extensions/Dockerfile index d2e0b540..3a79baf6 100644 --- a/extensions/Dockerfile +++ b/extensions/Dockerfile @@ -9,14 +9,20 @@ ADD . . ARG COSA ARG VARIANT RUN if [[ -z "$COSA" ]] ; then ci/get-ocp-repo.sh ; fi -# on SCOS, we need to add the GPG keys of the various SIGs we need -RUN if rpm -q centos-stream-release && ! rpm -q centos-release-cloud; then dnf install -y centos-release-{cloud,nfv,virt}-common; fi -RUN mkdir -p /usr/share/distribution-gpg-keys/centos -RUN ln -s /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial /usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-Official -RUN ln -s {/etc/pki/rpm-gpg,/usr/share/distribution-gpg-keys/centos}/RPM-GPG-KEY-CentOS-SIG-Cloud -RUN ln -s {/etc/pki/rpm-gpg,/usr/share/distribution-gpg-keys/centos}/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512 -RUN ln -s {/etc/pki/rpm-gpg,/usr/share/distribution-gpg-keys/centos}/RPM-GPG-KEY-CentOS-SIG-NFV -RUN ln -s {/etc/pki/rpm-gpg,/usr/share/distribution-gpg-keys/centos}/RPM-GPG-KEY-CentOS-SIG-Virtualization +# On SCOS, we need to add the GPG keys of the various SIGs we need +RUN if rpm -q centos-stream-release; then \ + if [[ $(rpm -q --qf "%{VERSION}" centos-stream-release) == "9.0" ]]; then \ + if ! rpm -q centos-release-cloud; then \ + dnf install -y centos-release-{cloud,nfv,virt}-common; \ + fi && \ + mkdir -p /usr/share/distribution-gpg-keys/centos && \ + ln -s /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial /usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-Official && \ + ln -s {/etc/pki/rpm-gpg,/usr/share/distribution-gpg-keys/centos}/RPM-GPG-KEY-CentOS-SIG-Cloud && \ + ln -s {/etc/pki/rpm-gpg,/usr/share/distribution-gpg-keys/centos}/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512 && \ + ln -s {/etc/pki/rpm-gpg,/usr/share/distribution-gpg-keys/centos}/RPM-GPG-KEY-CentOS-SIG-NFV && \ + ln -s {/etc/pki/rpm-gpg,/usr/share/distribution-gpg-keys/centos}/RPM-GPG-KEY-CentOS-SIG-Virtualization ; \ + fi ; \ + fi RUN if [[ -n "${VARIANT}" ]]; then MANIFEST="manifest-${VARIANT}.yaml"; EXTENSIONS="extensions-${VARIANT}.yaml"; else MANIFEST="manifest.yaml"; EXTENSIONS="extensions.yaml"; fi && rpm-ostree compose extensions --rootfs=/ --output-dir=/usr/share/rpm-ostree/extensions/ ./"${MANIFEST}" ./"${EXTENSIONS}" ## Creates the repo metadata for the extensions.