mockbuild: reuse nightly repos from redhat.repo

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
Ondřej Budai 2021-07-09 11:40:45 +02:00 committed by Ondřej Budai
parent c25e58bc9d
commit 0737136bc8

View file

@ -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