[UPD] support ubuntu 22.04

This commit is contained in:
Mathieu Benoit 2022-12-21 00:25:29 -05:00
parent 9cf2dbe46f
commit bfb2b0eea8
3 changed files with 100 additions and 22 deletions

View file

@ -14,10 +14,14 @@ EL_USER=${USER}
UBUNTU_VERSION=$(lsb_release -rs) UBUNTU_VERSION=$(lsb_release -rs)
if [ "20.04" == "${UBUNTU_VERSION}" ]; then if [ "20.04" == "${UBUNTU_VERSION}" ]; then
WKHTMLTOX_X64=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb WKHTMLTOX_X64=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
elif [ "22.04" == "${UBUNTU_VERSION}" ]; then
WKHTMLTOX_X64=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb
elif [ "18.04" == "${UBUNTU_VERSION}" ]; then elif [ "18.04" == "${UBUNTU_VERSION}" ]; then
WKHTMLTOX_X64=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb WKHTMLTOX_X64=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb
else else
WKHTMLTOX_X64=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_amd64.deb # TODO support debian
echo "Your version of Ubuntu is not supported, only support 18.04, 20.04 and 22.04"
exit 1
fi fi
#-------------------------------------------------- #--------------------------------------------------
@ -25,49 +29,114 @@ fi
#-------------------------------------------------- #--------------------------------------------------
echo -e "\n---- Update Server ----" echo -e "\n---- Update Server ----"
# add-apt-repository can install add-apt-repository Ubuntu 18.x if [ "18.04" == "${UBUNTU_VERSION}" ]; then
sudo apt-get install software-properties-common curl -y # add-apt-repository can install add-apt-repository Ubuntu 18.x
# universe package is for Ubuntu 18.x sudo apt-get install software-properties-common curl -y
sudo add-apt-repository universe # universe package is for Ubuntu 18.x
# libpng12-0 dependency for wkhtmltopdf sudo add-apt-repository universe
sudo add-apt-repository "deb http://mirrors.kernel.org/ubuntu/ xenial main" # libpng12-0 dependency for wkhtmltopdf
sudo apt-get update sudo add-apt-repository "deb http://mirrors.kernel.org/ubuntu/ xenial main"
sudo apt-get upgrade -y sudo apt-get update
sudo apt-get upgrade -y
fi
#-------------------------------------------------- #--------------------------------------------------
# Install PostgreSQL Server # Install PostgreSQL Server
#-------------------------------------------------- #--------------------------------------------------
echo -e "\n---- Install PostgreSQL Server ----" echo -e "\n---- Install PostgreSQL Server ----"
sudo apt-get install postgresql libpq-dev postgis -y sudo apt-get install postgresql libpq-dev postgis -y
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo "apt-get install postgresql installation error."
exit 1
fi
echo -e "\n---- Creating the ERPLibre PostgreSQL User ----" echo -e "\n---- Creating the ERPLibre PostgreSQL User ----"
sudo su - postgres -c "createuser -s ${EL_USER}" 2> /dev/null || true sudo su - postgres -c "createuser -s ${EL_USER}" 2>/dev/null || true
#-------------------------------------------------- #--------------------------------------------------
# Install Dependencies # Install Dependencies
#-------------------------------------------------- #--------------------------------------------------
echo -e "\n--- Installing debian dependency --" echo -e "\n--- Installing debian dependency --"
sudo apt-get install git build-essential wget libxslt-dev libzip-dev libldap2-dev libsasl2-dev libpng12-0 gdebi-core libffi-dev libbz2-dev parallel -y sudo apt-get install git build-essential wget libxslt-dev libzip-dev libldap2-dev libsasl2-dev gdebi-core libffi-dev libbz2-dev parallel -y
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo "apt-get debian tool installation error."
exit 1
fi
sudo apt-get install libmariadbd-dev -y sudo apt-get install libmariadbd-dev -y
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo "apt-get libmariadb installation error."
exit 1
fi
if [ "18.04" == "${UBUNTU_VERSION}" ]; then
sudo apt-get install libpng12-0 -y
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo "apt-get libpng installation error."
exit 1
fi
fi
# Dependencies for pyenv # Dependencies for pyenv
sudo apt-get install make libssl-dev zlib1g-dev libreadline-dev libsqlite3-dev curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev liblzma-dev -y sudo apt-get install make libssl-dev zlib1g-dev libreadline-dev libsqlite3-dev curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev liblzma-dev -y
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo "apt-get pyenv dependencies installation error."
exit 1
fi
echo -e "\n---- Installing nodeJS NPM and rtlcss for LTR support ----" echo -e "\n---- Installing nodeJS NPM and rtlcss for LTR support ----"
curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash - curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash -
sudo apt-get install -y nodejs sudo apt-get install -y nodejs
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo "apt-get nodejs installation error."
exit 1
fi
sudo npm install npm@latest -g sudo npm install npm@latest -g
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo "npm install npm lastest installation error."
exit 1
fi
sudo npm install -g rtlcss sudo npm install -g rtlcss
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo "npm install rtlcss installation error."
exit 1
fi
sudo npm install -g less sudo npm install -g less
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo "npm install less installation error."
exit 1
fi
echo -e "\n---- Test tool ----" echo -e "\n---- Test tool ----"
sudo npm install -g prettier sudo npm install -g prettier
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo "npm install prettier installation error."
exit 1
fi
sudo npm install -g prettier @prettier/plugin-xml sudo npm install -g prettier @prettier/plugin-xml
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo "npm install prettier plugin-xml installation error."
exit 1
fi
sudo ln -fs /usr/local/bin/lessc /usr/bin/lessc sudo ln -fs /usr/local/bin/lessc /usr/bin/lessc
if [ ${EL_INSTALL_NGINX} = "True" ]; then if [ ${EL_INSTALL_NGINX} = "True" ]; then
echo -e "\n---- Installing nginx ----" echo -e "\n---- Installing nginx ----"
sudo apt install nginx -y sudo apt install nginx -y
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo "apt install nginx installation error."
exit 1
fi
fi fi
#-------------------------------------------------- #--------------------------------------------------
@ -75,15 +144,21 @@ fi
#-------------------------------------------------- #--------------------------------------------------
if [ ${EL_INSTALL_WKHTMLTOPDF} = "True" ]; then if [ ${EL_INSTALL_WKHTMLTOPDF} = "True" ]; then
echo -e "\n---- Installing wkhtml ----" echo -e "\n---- Installing wkhtml ----"
INSTALLED=$(dpkg -s wkhtmltox|grep installed) INSTALLED=$(dpkg -s wkhtmltox | grep installed)
if [ "" == "${INSTALLED}" ]; then if [ "" == "${INSTALLED}" ]; then
echo -e "\n---- Install wkhtml and place shortcuts on correct place ----" echo -e "\n---- Install wkhtml and place shortcuts on correct place ----"
_url=${WKHTMLTOX_X64} _url=${WKHTMLTOX_X64}
sudo wget ${_url} sudo wget ${_url}
sudo gdebi --n `basename ${_url}` sudo gdebi --n $(basename ${_url})
sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin retVal=$?
sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin if [[ $retVal -ne 0 ]]; then
else echo -e "\n---- Already installed wkhtml ----" echo "gdebi install wkhtmltopdf installation error."
exit 1
fi
sudo ln -fs /usr/local/bin/wkhtmltopdf /usr/bin
sudo ln -fs /usr/local/bin/wkhtmltoimage /usr/bin
else
echo -e "\n---- Already installed wkhtml ----"
fi fi
else else
echo "Wkhtmltopdf isn't installed due to the choice of the user!" echo "Wkhtmltopdf isn't installed due to the choice of the user!"

View file

@ -4,14 +4,14 @@ if [[ "${OSTYPE}" == "linux-gnu" ]]; then
OS=$(lsb_release -si) OS=$(lsb_release -si)
VERSION=$(cat /etc/issue) VERSION=$(cat /etc/issue)
if [[ "${OS}" == "Ubuntu" ]]; then if [[ "${OS}" == "Ubuntu" ]]; then
if [[ "${VERSION}" == Ubuntu\ 18.04* || "${VERSION}" == Ubuntu\ 20.04* ]]; then if [[ "${VERSION}" == Ubuntu\ 18.04* || "${VERSION}" == Ubuntu\ 20.04* || "${VERSION}" == Ubuntu\ 22.04* ]]; then
echo "\n---- linux-gnu installation process started ----" echo "\n---- linux-gnu installation process started ----"
./script/install_debian_dependency.sh ./script/install_debian_dependency.sh
else else
echo "Your version is not supported, only support 18.04 and 20.04 : ${VERSION}" echo "Your version is not supported, only support 18.04, 20.04 and 22.04 : ${VERSION}"
fi fi
else else
echo "Your Linux system is not supported, only support Ubuntu 18.04 or Ubuntu 20.04." echo "Your Linux system is not supported, only support Ubuntu 18.04 or Ubuntu 20.04 or Ubuntu 22.04."
fi fi
elif [[ "${OSTYPE}" == "darwin"* ]]; then elif [[ "${OSTYPE}" == "darwin"* ]]; then
echo "\n---- Darwin installation process started ----" echo "\n---- Darwin installation process started ----"

View file

@ -128,6 +128,9 @@ if [[ ! -f "${POETRY_PATH}" ]]; then
${VENV_PATH}/bin/pip install vatnumber ${VENV_PATH}/bin/pip install vatnumber
${VENV_PATH}/bin/pip install suds-jurko ${VENV_PATH}/bin/pip install suds-jurko
fi fi
${VENV_PATH}/bin/pip install vatnumber
${VENV_PATH}/bin/pip install suds-jurko
# Delete artifacts created by pip, cause error in next "poetry install" # Delete artifacts created by pip, cause error in next "poetry install"
rm -rf artifacts rm -rf artifacts