Do RHN registration in deploy + mockbuild

Check to see if the instance is registered prior to attempting
registration. Also, ensure that registration happens during mock build
and during the deployment.

Signed-off-by: Major Hayden <major@redhat.com>
This commit is contained in:
Major Hayden 2020-07-09 16:43:38 -05:00 committed by Major Hayden
parent 785bdbae30
commit db5fb9908a
2 changed files with 7 additions and 1 deletions

View file

@ -19,7 +19,7 @@ if [[ $ID == rhel ]] && ! rpm -q epel-release; then
fi
# Register RHEL if we are provided with a registration script.
if [[ -n "${RHN_REGISTRATION_SCRIPT:-}" ]]; then
if [[ -n "${RHN_REGISTRATION_SCRIPT:-}" ]] && ! sudo subscription-manager status; then
greenprint "🪙 Registering RHEL instance"
sudo chmod +x $RHN_REGISTRATION_SCRIPT
sudo $RHN_REGISTRATION_SCRIPT