Files
loci/scripts/install.sh
Andrii Ostapenko d5ff58a973 Update dockerfiles and gates
Introduces image build for bionic with py3 and nautilus.
Switches centos to py3 and fixes related issues.
Xenial is now run with stable/ocata.

Adds ability to skip specific build for particular component specifying
"supported_releases" in zuul component configuration. Sets
supported_releases for placement not available for releases prior to
Stein.

Removes redundant parameters for project reference using defaults
instead, as they relate to loci project, not to project we build
with loci. Also hard-codes parameters in playbooks/vars.yaml, making
it a definitive build configuration.

Change-Id: I7290203d80461f46ed70d5e3bea55c9765f9e746
2020-01-20 19:37:55 -06:00

96 lines
2.6 KiB
Bash
Executable File

#!/bin/bash
set -ex
distro=$(awk -F= '/^ID=/ {gsub(/\"/, "", $2); print $2}' /etc/*release)
export distro=${DISTRO:=$distro}
if [[ "${PYTHON3}" == "no" ]]; then
dpkg_python_packages=("python" "virtualenv")
rpm_python_packages=("python" "python-virtualenv")
python3=""
else
dpkg_python_packages=("python3" "python3-virtualenv" "python3-distutils")
rpm_python_packages=("python3")
python3="python3"
fi
case ${distro} in
debian|ubuntu)
apt-get update
apt-get upgrade -y
apt-get install -y --no-install-recommends \
git \
ca-certificates \
netbase \
lsb-release \
patch \
sudo \
${dpkg_python_packages[@]}
;;
centos)
yum upgrade -y
yum install -y --setopt=skip_missing_names_on_install=False \
git \
patch \
redhat-lsb-core \
sudo \
${rpm_python_packages[@]}
if [[ "${PYTHON3}" != "no" ]]; then
pip3 install virtualenv
fi
;;
opensuse|opensuse-leap|opensuse-tumbleweed|sles)
if [[ "${PYTHON3}" == "no" ]]; then
rpm_python_packages+=("python-devel" "python-setuptools")
else
rpm_python_packages+=("python3-devel" "python3-setuptools"
"python3-virtualenv")
fi
zypper --non-interactive --gpg-auto-import-keys refresh
zypper --non-interactive install --no-recommends \
ca-certificates \
git-core \
lsb-release \
patch \
sudo \
tar \
${rpm_python_packages[@]}
;;
*)
echo "Unknown distro: ${distro}"
exit 1
;;
esac
if [[ "${PROJECT}" == "requirements" ]]; then
$(dirname $0)/requirements.sh
exit 0
fi
$(dirname $0)/fetch_wheels.sh
if [[ "${PROJECT}" == "infra" ]]; then
$(dirname $0)/setup_pip.sh
$(dirname $0)/pip_install.sh bindep ${PIP_PACKAGES}
$(dirname $0)/install_packages.sh
$(dirname $0)/cleanup.sh
exit 0
fi
if [[ "${PLUGIN}" == "no" ]]; then
$(dirname $0)/create_user.sh
$(dirname $0)/setup_pip.sh
$(dirname $0)/pip_install.sh bindep
for file in /opt/loci/pydep*; do
PYDEP_PACKAGES+=($(bindep -f $file -b -l newline ${PROJECT} ${PROJECT_RELEASE} ${PROFILES} ${python3} || :))
done
$(dirname $0)/pip_install.sh ${PYDEP_PACKAGES[@]}
fi
if [[ ${PROJECT} == 'nova' ]]; then
$(dirname $0)/install_nova_console.sh
fi
$(dirname $0)/clone_project.sh
$(dirname $0)/install_packages.sh
$(dirname $0)/pip_install.sh /tmp/${PROJECT} ${PIP_PACKAGES}
$(dirname $0)/cleanup.sh