From 0737136bc85f6813edc04b165f66c09679b3e98a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Fri, 9 Jul 2021 11:40:45 +0200 Subject: [PATCH] mockbuild: reuse nightly repos from redhat.repo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: OndΕ™ej Budai --- schutzbot/mockbuild.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/schutzbot/mockbuild.sh b/schutzbot/mockbuild.sh index d1414771e..87c9a7262 100755 --- a/schutzbot/mockbuild.sh +++ b/schutzbot/mockbuild.sh @@ -87,12 +87,14 @@ greenprint "🧬 Using mock config: ${MOCK_CONFIG}" greenprint "πŸ“¦ SHA: ${COMMIT}" greenprint "πŸ“€ RPMS will be uploaded to: ${REPO_URL}" -if [[ $VERSION_ID == 8.5 ]]; then - greenprint "πŸ“‹ Updating RHEL 8 mock template for unsubscribed image" +if [[ "$ID" == rhel && ${VERSION_ID%.*} == 8 ]] && ! sudo subscription-manager status; then + greenprint "πŸ“‹ Updating RHEL 8 mock template with the latest nightly repositories" + # strip everything after line with # repos sudo sed -i '/# repos/q' /etc/mock/templates/rhel-8.tpl # remove the subscription check sudo sed -i "s/config_opts\['redhat_subscription_required'\] = True/config_opts['redhat_subscription_required'] = False/" /etc/mock/templates/rhel-8.tpl - cat "$RHEL85_NIGHTLY_REPO" | sudo tee -a /etc/mock/templates/rhel-8.tpl > /dev/null + # reuse redhat.repo + cat /etc/yum.repos.d/rhel8internal.repo | sudo tee -a /etc/mock/templates/rhel-8.tpl > /dev/null # We need triple quotes at the end of the template to mark the end of the repo list. echo '"""' | sudo tee -a /etc/mock/templates/rhel-8.tpl elif [[ $VERSION_ID == 9.0 ]]; then