From 4266e18886307eaf5c1e6f1743b18c96092486c5 Mon Sep 17 00:00:00 2001 From: "Yenthe V.G" Date: Thu, 21 Sep 2017 14:01:11 +0200 Subject: [PATCH] WIP: Odoo 11 installation script (compatibility for Py2 & Py3) --- odoo_install.sh | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/odoo_install.sh b/odoo_install.sh index f3115a8..3f20d11 100644 --- a/odoo_install.sh +++ b/odoo_install.sh @@ -1,6 +1,6 @@ #!/bin/bash ################################################################################ -# Script for installing Odoo V10 on Ubuntu 16.04, 15.04, 14.04 (could be used for other version too) +# Script for installing Odoo on Ubuntu 14.04, 15.04 and 16.04 (could be used for other version too) # Author: Yenthe Van Ginneken #------------------------------------------------------------------------------- # This script will install Odoo on your Ubuntu 14.04 server. It can install multiple Odoo instances @@ -24,10 +24,10 @@ OE_HOME_EXT="/$OE_USER/${OE_USER}-server" INSTALL_WKHTMLTOPDF="True" #Set the default Odoo port (you still have to use -c /etc/odoo-server.conf for example to use this.) OE_PORT="8069" -#Choose the Odoo version which you want to install. For example: 10.0, 9.0, 8.0, 7.0 or saas-6. When using 'trunk' the master version will be installed. -#IMPORTANT! This script contains extra libraries that are specifically needed for Odoo 10.0 -OE_VERSION="10.0" -# Set this to True if you want to install Odoo 10 Enterprise! +#Choose the Odoo version which you want to install. For example: 9.0, 8.0, 7.0 or saas-6. When using 'trunk' the master version will be installed. +#IMPORTANT! This script contains extra libraries that are specifically needed for Odoo 9.0 +OE_VERSION="11.0" +# Set this to True if you want to install Odoo 9 Enterprise! IS_ENTERPRISE="False" #set the superadmin password OE_SUPERADMIN="admin" @@ -60,14 +60,20 @@ sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true #-------------------------------------------------- # Install Dependencies #-------------------------------------------------- +echo -e "\n--- Installing Python 3 + pip3 --" +sudo apt-get install python3 python3-pip + echo -e "\n---- Install tool packages ----" -sudo apt-get install wget git python-pip gdebi-core -y +sudo apt-get install wget git bzr python-pip gdebi-core -y echo -e "\n---- Install python packages ----" -sudo apt-get install python-dateutil python-feedparser python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-docutils python-psutil python-mock python-unittest2 python-jinja2 python-pypdf python-decorator python-requests python-passlib python-pil -y python-suds +sudo apt-get install python-pypdf2 python-dateutil python-feedparser python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-docutils python-psutil python-mock python-unittest2 python-jinja2 python-pypdf python-decorator python-requests python-passlib python-pil -y +sudo pip3 install pypdf2 Babel passlib Werkzeug decorator python-dateutil pyyaml psycopg2 psutil html2text docutils echo -e "\n---- Install python libraries ----" -sudo pip install gdata psycogreen ofxparse XlsxWriter xlrd +sudo pip install gdata psycogreen +# This is for compatibility with Ubuntu 16.04. Will work on 14.04, 15.04 and 16.04 +sudo -H pip install suds echo -e "\n--- Install other required packages" sudo apt-get install node-clean-css -y @@ -78,7 +84,7 @@ sudo apt-get install python-gevent -y # Install Wkhtmltopdf if needed #-------------------------------------------------- if [ $INSTALL_WKHTMLTOPDF = "True" ]; then - echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 10 ----" + echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 11 ----" #pick up correct one from x64 & x32 versions: if [ "`getconf LONG_BIT`" == "64" ];then _url=$WKHTMLTOX_X64 @@ -115,7 +121,7 @@ if [ $IS_ENTERPRISE = "True" ]; then sudo su $OE_USER -c "mkdir $OE_HOME/enterprise" sudo su $OE_USER -c "mkdir $OE_HOME/enterprise/addons" - GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch 10.0 https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1) + GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1) while [[ $GITHUB_RESPONSE == *"Authentication"* ]]; do echo "------------------------WARNING------------------------------" echo "Your authentication with Github has failed! Please try again." @@ -123,7 +129,7 @@ if [ $IS_ENTERPRISE = "True" ]; then echo "TIP: Press ctrl+c to stop this script." echo "-------------------------------------------------------------" echo " " - GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch 10.0 https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1) + GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1) done echo -e "\n---- Added Enterprise code under $OE_HOME/enterprise/addons ----" @@ -183,16 +189,12 @@ PATH=/bin:/sbin:/usr/bin DAEMON=$OE_HOME_EXT/odoo-bin NAME=$OE_CONFIG DESC=$OE_CONFIG - # Specify the user name (Default: odoo). USER=$OE_USER - # Specify an alternate config file (Default: /etc/openerp-server.conf). CONFIGFILE="/etc/${OE_CONFIG}.conf" - # pidfile PIDFILE=/var/run/\${NAME}.pid - # Additional options that are passed to the Daemon. DAEMON_OPTS="-c \$CONFIGFILE" [ -x \$DAEMON ] || exit 0 @@ -203,7 +205,6 @@ pid=\`cat \$PIDFILE\` [ -d /proc/\$pid ] && return 0 return 1 } - case "\${1}" in start) echo -n "Starting \${DESC}: " @@ -218,7 +219,6 @@ start-stop-daemon --stop --quiet --pidfile \$PIDFILE \ --oknodo echo "\${NAME}." ;; - restart|force-reload) echo -n "Restarting \${DESC}: " start-stop-daemon --stop --quiet --pidfile \$PIDFILE \ @@ -234,7 +234,6 @@ N=/etc/init.d/\$NAME echo "Usage: \$NAME {start|stop|restart|force-reload}" >&2 exit 1 ;; - esac exit 0 EOF