mockbuild: register the host as soon as possible
So we can check if we are subscribed in the variable definitions. I believe that registering the instance will go away soon nevertheless.
This commit is contained in:
parent
54f233ac96
commit
41e01326f0
1 changed files with 8 additions and 8 deletions
|
|
@ -10,6 +10,14 @@ function greenprint {
|
|||
source /etc/os-release
|
||||
ARCH=$(uname -m)
|
||||
|
||||
# Register RHEL if we are provided with a registration script and intend to do that.
|
||||
REGISTER="${REGISTER:-'false'}"
|
||||
if [[ $REGISTER == "true" && -n "${RHN_REGISTRATION_SCRIPT:-}" ]] && ! sudo subscription-manager status; then
|
||||
greenprint "🪙 Registering RHEL instance"
|
||||
sudo chmod +x "$RHN_REGISTRATION_SCRIPT"
|
||||
sudo "$RHN_REGISTRATION_SCRIPT"
|
||||
fi
|
||||
|
||||
# Mock configuration file to use for building RPMs.
|
||||
MOCK_CONFIG="${ID}-${VERSION_ID%.*}-$(uname -m)"
|
||||
|
||||
|
|
@ -50,14 +58,6 @@ if [[ $ID == rhel || $ID == centos ]] && ! rpm -q epel-release; then
|
|||
sudo rpm -Uvh /tmp/epel.rpm
|
||||
fi
|
||||
|
||||
# Register RHEL if we are provided with a registration script and intend to do that.
|
||||
REGISTER="${REGISTER:-'false'}"
|
||||
if [[ $REGISTER == "true" && -n "${RHN_REGISTRATION_SCRIPT:-}" ]] && ! sudo subscription-manager status; then
|
||||
greenprint "🪙 Registering RHEL instance"
|
||||
sudo chmod +x "$RHN_REGISTRATION_SCRIPT"
|
||||
sudo "$RHN_REGISTRATION_SCRIPT"
|
||||
fi
|
||||
|
||||
# Install requirements for building RPMs in mock.
|
||||
greenprint "📦 Installing mock requirements"
|
||||
sudo dnf -y install createrepo_c make mock python3-pip rpm-build s3cmd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue