Adding option to disable repos installation
This commit is contained in:
@@ -79,3 +79,8 @@ PRESERVE="3"
|
|||||||
# If set to true together with cert/key paths, defined pem key/certificate will be created if neither exists.
|
# If set to true together with cert/key paths, defined pem key/certificate will be created if neither exists.
|
||||||
# options: true/false
|
# options: true/false
|
||||||
#AUTOCERT="false"
|
#AUTOCERT="false"
|
||||||
|
|
||||||
|
# If set to true, this will install the rpm/deb respoitories necessary for the Xen Orchestra intall. If set to false, these repositories will not be installed.
|
||||||
|
# options: true/false
|
||||||
|
# default: true
|
||||||
|
#INSTALL_REPOS="true"
|
||||||
|
@@ -41,6 +41,7 @@ PATH_TO_HTTPS_KEY="${PATH_TO_HTTPS_KEY:-""}"
|
|||||||
AUTOCERT="${AUTOCERT:-"false"}"
|
AUTOCERT="${AUTOCERT:-"false"}"
|
||||||
USESUDO="${USESUDO:-"false"}"
|
USESUDO="${USESUDO:-"false"}"
|
||||||
GENSUDO="${GENSUDO:-"false"}"
|
GENSUDO="${GENSUDO:-"false"}"
|
||||||
|
INSTALL_REPOS="${INSTALL_REPOS:-"true"}"
|
||||||
|
|
||||||
# set variables not changeable in configfile
|
# set variables not changeable in configfile
|
||||||
TIME=$(date +%Y%m%d%H%M)
|
TIME=$(date +%Y%m%d%H%M)
|
||||||
@@ -196,8 +197,8 @@ function InstallDependenciesRPM {
|
|||||||
|
|
||||||
# Install necessary dependencies for XO build
|
# Install necessary dependencies for XO build
|
||||||
|
|
||||||
# only install epel-release if doesn't exist
|
# only install epel-release if doesn't exist and user allows it to be installed
|
||||||
if [[ -z $(runcmd_stdout "rpm -qa epel-release") ]]; then
|
if [[ -z $(runcmd_stdout "rpm -qa epel-release") ]] && [[ "$INSTALL_REPOS" == "true" ]]; then
|
||||||
echo
|
echo
|
||||||
printprog "Installing epel-repo"
|
printprog "Installing epel-repo"
|
||||||
runcmd "yum -y install epel-release"
|
runcmd "yum -y install epel-release"
|
||||||
@@ -214,7 +215,13 @@ function InstallDependenciesRPM {
|
|||||||
if [[ -z $(runcmd_stdout "command -v node") ]]; then
|
if [[ -z $(runcmd_stdout "command -v node") ]]; then
|
||||||
echo
|
echo
|
||||||
printprog "Installing node.js"
|
printprog "Installing node.js"
|
||||||
|
|
||||||
|
# only install nodejs repo if user allows it to be installed
|
||||||
|
if [[ "$INSTALL_REPOS" == "true" ]]; then
|
||||||
runcmd "curl -s -L https://rpm.nodesource.com/setup_${NODEVERSION}.x | bash -"
|
runcmd "curl -s -L https://rpm.nodesource.com/setup_${NODEVERSION}.x | bash -"
|
||||||
|
fi
|
||||||
|
|
||||||
|
runcmd "yum install -y nodejs"
|
||||||
printok "Installing node.js"
|
printok "Installing node.js"
|
||||||
else
|
else
|
||||||
UpdateNodeYarn
|
UpdateNodeYarn
|
||||||
@@ -224,7 +231,13 @@ function InstallDependenciesRPM {
|
|||||||
if [[ -z $(runcmd_stdout "command -v yarn") ]]; then
|
if [[ -z $(runcmd_stdout "command -v yarn") ]]; then
|
||||||
echo
|
echo
|
||||||
printprog "Installing yarn"
|
printprog "Installing yarn"
|
||||||
runcmd "curl -s -o /etc/yum.repos.d/yarn.repo https://dl.yarnpkg.com/rpm/yarn.repo && yum -y install yarn"
|
|
||||||
|
# only install yarn repo if user allows it to be installed
|
||||||
|
if [[ "$INSTALL_REPOS" == "true" ]]; then
|
||||||
|
runcmd "curl -s -o /etc/yum.repos.d/yarn.repo https://dl.yarnpkg.com/rpm/yarn.repo"
|
||||||
|
fi
|
||||||
|
|
||||||
|
runcmd "yum -y install yarn"
|
||||||
printok "Installing yarn"
|
printok "Installing yarn"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -310,7 +323,12 @@ function InstallDependenciesDeb {
|
|||||||
if [[ -z $(runcmd_stdout "command -v node") ]] || [[ -z $(runcmd_stdout "command -v npm") ]]; then
|
if [[ -z $(runcmd_stdout "command -v node") ]] || [[ -z $(runcmd_stdout "command -v npm") ]]; then
|
||||||
echo
|
echo
|
||||||
printprog "Installing node.js"
|
printprog "Installing node.js"
|
||||||
|
|
||||||
|
# only install nodejs repo if user allows it to be installed
|
||||||
|
if [[ "$INSTALL_REPOS" == "true" ]]; then
|
||||||
runcmd "curl -sL https://deb.nodesource.com/setup_${NODEVERSION}.x | bash -"
|
runcmd "curl -sL https://deb.nodesource.com/setup_${NODEVERSION}.x | bash -"
|
||||||
|
fi
|
||||||
|
|
||||||
runcmd "apt-get install -y nodejs"
|
runcmd "apt-get install -y nodejs"
|
||||||
printok "Installing node.js"
|
printok "Installing node.js"
|
||||||
else
|
else
|
||||||
@@ -321,8 +339,13 @@ function InstallDependenciesDeb {
|
|||||||
if [[ -z $(runcmd_stdout "command -v yarn") ]]; then
|
if [[ -z $(runcmd_stdout "command -v yarn") ]]; then
|
||||||
echo
|
echo
|
||||||
printprog "Installing yarn"
|
printprog "Installing yarn"
|
||||||
|
|
||||||
|
# only install yarn repo if user allows it to be installed
|
||||||
|
if [[ "$INSTALL_REPOS" == "true" ]]; then
|
||||||
runcmd "curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -"
|
runcmd "curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -"
|
||||||
runcmd "echo \"deb https://dl.yarnpkg.com/debian/ stable main\" | tee /etc/apt/sources.list.d/yarn.list"
|
runcmd "echo \"deb https://dl.yarnpkg.com/debian/ stable main\" | tee /etc/apt/sources.list.d/yarn.list"
|
||||||
|
fi
|
||||||
|
|
||||||
runcmd "apt-get update"
|
runcmd "apt-get update"
|
||||||
runcmd "apt-get install -y yarn"
|
runcmd "apt-get install -y yarn"
|
||||||
printok "Installing yarn"
|
printok "Installing yarn"
|
||||||
@@ -360,7 +383,12 @@ function UpdateNodeYarn {
|
|||||||
if [[ -n "$NODEV" ]] && [[ "$NODEV" -lt "${NODEVERSION}" ]]; then
|
if [[ -n "$NODEV" ]] && [[ "$NODEV" -lt "${NODEVERSION}" ]]; then
|
||||||
echo
|
echo
|
||||||
printprog "node.js version is $NODEV, upgrading to ${NODEVERSION}.x"
|
printprog "node.js version is $NODEV, upgrading to ${NODEVERSION}.x"
|
||||||
|
|
||||||
|
# only install nodejs repo if user allows it to be installed
|
||||||
|
if [[ "$INSTALL_REPOS" == "true" ]]; then
|
||||||
runcmd "curl -sL https://rpm.nodesource.com/setup_${NODEVERSION}.x | bash -"
|
runcmd "curl -sL https://rpm.nodesource.com/setup_${NODEVERSION}.x | bash -"
|
||||||
|
fi
|
||||||
|
|
||||||
runcmd "yum clean all"
|
runcmd "yum clean all"
|
||||||
runcmd "yum install -y nodejs"
|
runcmd "yum install -y nodejs"
|
||||||
printok "node.js version is $NODEV, upgrading to ${NODEVERSION}.x"
|
printok "node.js version is $NODEV, upgrading to ${NODEVERSION}.x"
|
||||||
@@ -381,7 +409,12 @@ function UpdateNodeYarn {
|
|||||||
if [[ -n "$NODEV" ]] && [[ "$NODEV" -lt "${NODEVERSION}" ]]; then
|
if [[ -n "$NODEV" ]] && [[ "$NODEV" -lt "${NODEVERSION}" ]]; then
|
||||||
echo
|
echo
|
||||||
printprog "node.js version is $NODEV, upgrading to ${NODEVERSION}.x"
|
printprog "node.js version is $NODEV, upgrading to ${NODEVERSION}.x"
|
||||||
|
|
||||||
|
# only install nodejs repo if user allows it to be installed
|
||||||
|
if [[ "$INSTALL_REPOS" == "true" ]]; then
|
||||||
runcmd "curl -sL https://deb.nodesource.com/setup_${NODEVERSION}.x | bash -"
|
runcmd "curl -sL https://deb.nodesource.com/setup_${NODEVERSION}.x | bash -"
|
||||||
|
fi
|
||||||
|
|
||||||
runcmd "apt-get install -y nodejs"
|
runcmd "apt-get install -y nodejs"
|
||||||
printok "node.js version is $NODEV, upgrading to ${NODEVERSION}.x"
|
printok "node.js version is $NODEV, upgrading to ${NODEVERSION}.x"
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user