setup-yum-repo: Add prod flag for doing IUS install on CentOS.

This commit is contained in:
rht
2019-01-04 20:40:27 +00:00
committed by Tim Abbott
parent 21c71a0c52
commit d8a081b94c

View File

@@ -2,12 +2,28 @@
set -x
set -e
is_prod=false
args="$(getopt -o '' --long prod -- "$@")"
eval "set -- $args"
while true; do
case "$1" in
--prod) is_prod=true; shift;;
--) shift; break;;
esac
done
is_centos=false
is_rhel=false
is_rhel_registered=false
if [ -e /etc/centos-release ]; then
is_centos=true
yum install -y epel-release
if [ "$is_prod" = true ]; then
# IUS is needed for installing python36u-mod_wsgi on prod env
yum localinstall -y https://centos7.iuscommunity.org/ius-release.rpm
fi
elif grep -q "Red Hat" /etc/redhat-release; then
is_rhel=true
yum localinstall -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
@@ -18,6 +34,7 @@ elif grep -q "Red Hat" /etc/redhat-release; then
subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms"
fi
fi
yum update -y
# "Development Tools" is the equivalent of build-essential