Allow to control custom repo via CP_REPO_ENABLED
@@ -362,12 +362,12 @@ function configure_package_manager {
fi
# Add a Cloud Pipeline repo, which contains the required runtime packages
+ if [ "${CP_REPO_ENABLED,,}" == 'true' ]; then
local CP_REPO_BASE_URL_DEFAULT="${CP_REPO_BASE_URL_DEFAULT:-https://cloud-pipeline-oss-builds.s3.amazonaws.com/tools/repos}"
local CP_REPO_BASE_URL="${CP_REPO_BASE_URL_DEFAULT}/${CP_OS}/${CP_VER}"
if [ "$CP_OS" == "centos" ]; then
- yum install curl yum-priorities -y -q && \
- curl -sk "${CP_REPO_BASE_URL}/cloud-pipeline.repo" > /etc/yum.repos.d/cloud-pipeline.repo
- yum --disablerepo=* --enablerepo=cloud-pipeline list available > /dev/null 2>&1
+ curl -sk "${CP_REPO_BASE_URL}/cloud-pipeline.repo" > /etc/yum.repos.d/cloud-pipeline.repo && \
+ yum --disablerepo=* --enablerepo=cloud-pipeline install yum-priorities -y -q > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "[ERROR] Failed to configure $CP_REPO_BASE_URL for the yum, removing the repo"
@@ -386,6 +386,7 @@ function configure_package_manager {
sed -i "\|${CP_REPO_BASE_URL}|d" /etc/apt/sources.list
fi
fi
+ fi
}
# Generates apt-get or yum command to install specified list of packages (second argument)
@@ -416,8 +417,14 @@ function get_install_command_by_current_distr {
_INSTALL_COMMAND_TEXT=
else
check_installed "apt-get" && { _INSTALL_COMMAND_TEXT="rm -rf /var/lib/apt/lists/; apt-get update -y -qq --allow-insecure-repositories; DEBIAN_FRONTEND=noninteractive apt-get -y -qq --allow-unauthenticated install $_TOOLS_TO_INSTALL_VERIFIED"; };
- check_installed "yum" && { _INSTALL_COMMAND_TEXT="yum clean all -q && yum -y -q install $_TOOLS_TO_INSTALL_VERIFIED"; };
+ if check_installed "yum"; then
check_installed "apk" && { _INSTALL_COMMAND_TEXT="apk update -q 1>/dev/null; apk -q add $_TOOLS_TO_INSTALL_VERIFIED"; };
+ if [ "$CP_REPO_ENABLED" == "true" ] && [ -f /etc/yum.repos.d/cloud-pipeline.repo ]; then
+ _INSTALL_COMMAND_TEXT="yum clean all -q && yum --disablerepo=* --enablerepo=cloud-pipeline -y -q install $_TOOLS_TO_INSTALL_VERIFIED"
+ else
+ _INSTALL_COMMAND_TEXT="yum clean all -q && yum -y -q install $_TOOLS_TO_INSTALL_VERIFIED"
+ fi
+ fi
fi
eval $_RESULT_VAR=\$_INSTALL_COMMAND_TEXT
@@ -872,7 +879,7 @@ SSH_SERVER_EXEC_PATH='/usr/sbin/sshd'
if ! [ -f $SSH_SERVER_EXEC_PATH ] ;
then
# Check which package manager to use for SSH Server installation
- SSH_INSTALL_COMMAND=
+ e=
get_install_command_by_current_distr SSH_INSTALL_COMMAND "openssh-server"
if [ -z "$SSH_INSTALL_COMMAND" ] ;
