mockbuild: move registration on top of the file
we did the same in osbuild and composer
This commit is contained in:
parent
345265e9d2
commit
748e08d434
1 changed files with 7 additions and 7 deletions
|
|
@ -10,6 +10,13 @@ function greenprint {
|
|||
source /etc/os-release
|
||||
ARCH=$(uname -m)
|
||||
|
||||
# Register RHEL if we are provided with a registration script.
|
||||
if [[ -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)"
|
||||
|
||||
|
|
@ -46,13 +53,6 @@ if [[ $ID == rhel ]] && ! rpm -q epel-release; then
|
|||
sudo rpm -Uvh /tmp/epel.rpm
|
||||
fi
|
||||
|
||||
# Register RHEL if we are provided with a registration script.
|
||||
if [[ -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 mock s3cmd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue