mockbuild: move installing dependencies down
These don't need to run when we're not building anything.
This commit is contained in:
parent
4b084e3b64
commit
efba431e05
1 changed files with 19 additions and 19 deletions
|
|
@ -10,25 +10,6 @@ function greenprint {
|
||||||
source /etc/os-release
|
source /etc/os-release
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
|
|
||||||
# mock and s3cmd are only available in EPEL for RHEL.
|
|
||||||
if [[ $ID == rhel ]]; then
|
|
||||||
greenprint "📦 Setting up EPEL repository"
|
|
||||||
curl -Ls --retry 5 --output /tmp/epel.rpm \
|
|
||||||
https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
|
|
||||||
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 make mock python3-pip rpm-build s3cmd
|
|
||||||
|
|
||||||
# Mock configuration file to use for building RPMs.
|
# Mock configuration file to use for building RPMs.
|
||||||
MOCK_CONFIG="${ID}-${VERSION_ID%.*}-$(uname -m)"
|
MOCK_CONFIG="${ID}-${VERSION_ID%.*}-$(uname -m)"
|
||||||
|
|
||||||
|
|
@ -57,6 +38,25 @@ if curl --silent --fail --head --output /dev/null "${REPO_URL}/repodata/repomd.x
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# mock and s3cmd are only available in EPEL for RHEL.
|
||||||
|
if [[ $ID == rhel ]]; then
|
||||||
|
greenprint "📦 Setting up EPEL repository"
|
||||||
|
curl -Ls --retry 5 --output /tmp/epel.rpm \
|
||||||
|
https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
|
||||||
|
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 make mock python3-pip rpm-build s3cmd
|
||||||
|
|
||||||
# Print some data.
|
# Print some data.
|
||||||
greenprint "🧬 Using mock config: ${MOCK_CONFIG}"
|
greenprint "🧬 Using mock config: ${MOCK_CONFIG}"
|
||||||
greenprint "📦 SHA: ${COMMIT}"
|
greenprint "📦 SHA: ${COMMIT}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue