From a9218eea7190da5e2a13d19e7a2ad87b2a6136da Mon Sep 17 00:00:00 2001 From: Yenthe Date: Sun, 24 Apr 2016 17:22:04 +0200 Subject: [PATCH 1/6] Create ability to install any Odoo version on any Ubuntu version --- odoo_install.sh | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/odoo_install.sh b/odoo_install.sh index e227a17d..fc028e27 100644 --- a/odoo_install.sh +++ b/odoo_install.sh @@ -1,6 +1,6 @@ #!/bin/bash ################################################################################ -# Script for installing Odoo V9 on Ubuntu 14.04 LTS (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 @@ -27,6 +27,8 @@ OE_PORT="8069" #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="9.0" +# Set this to True if you want to install Odoo 9 Enterprise! +IS_ENTERPRISE="False" #set the superadmin password OE_SUPERADMIN="admin" OE_CONFIG="${OE_USER}-server" @@ -65,7 +67,9 @@ 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 echo -e "\n---- Install python libraries ----" -sudo pip install gdata psycogreen ofxparse +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 @@ -106,9 +110,25 @@ sudo chown $OE_USER:$OE_USER /var/log/$OE_USER echo -e "\n==== Installing ODOO Server ====" sudo git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/odoo $OE_HOME_EXT/ -echo -e "\n---- Create custom module directory ----" -sudo su $OE_USER -c "mkdir $OE_HOME/custom" -sudo su $OE_USER -c "mkdir $OE_HOME/custom/addons" +if [ $IS_ENTERPRISE = "True" ]; then + # Odoo Enterprise install! + echo -e "\n--- Create symlink for node" + sudo ln -s /usr/bin/nodejs /usr/bin/node + sudo su $OE_USER -c "mkdir $OE_HOME/enterprise" + sudo su $OE_USER -c "mkdir $OE_HOME/enterprise/addons" + + echo -e "\n---- Adding Enterprise code under $OE_HOME/enterprise/addons ----" + sudo git clone --depth 1 --branch 9.0 https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" + + echo -e "\n---- Installing Enterprise specific libraries ----" + sudo apt-get install nodejs npm + sudo npm install -g less + sudo npm install -g less-plugin-clean-css +else + echo -e "\n---- Create custom module directory ----" + sudo su $OE_USER -c "mkdir $OE_HOME/custom" + sudo su $OE_USER -c "mkdir $OE_HOME/custom/addons" +fi echo -e "\n---- Setting permissions on home folder ----" sudo chown -R $OE_USER:$OE_USER $OE_HOME/* @@ -122,8 +142,12 @@ echo -e "* Change server config file" sudo sed -i s/"db_user = .*"/"db_user = $OE_USER"/g /etc/${OE_CONFIG}.conf sudo sed -i s/"; admin_passwd.*"/"admin_passwd = $OE_SUPERADMIN"/g /etc/${OE_CONFIG}.conf sudo su root -c "echo 'logfile = /var/log/$OE_USER/$OE_CONFIG$1.log' >> /etc/${OE_CONFIG}.conf" -sudo su root -c "echo 'addons_path=$OE_HOME_EXT/addons,$OE_HOME/custom/addons' >> /etc/${OE_CONFIG}.conf" - +if [ $IS_ENTERPRISE = "True" ]; then + sudo su root -c "echo 'addons_path=$OE_HOME/enterprise/addons,$OE_HOME_EXT/addons' >> /etc/${OE_CONFIG}.conf" +else + sudo su root -c "echo 'addons_path=$OE_HOME_EXT/addons,$OE_HOME/custom/addons' >> /etc/${OE_CONFIG}.conf" +fi + echo -e "* Create startup file" sudo su root -c "echo '#!/bin/sh' >> $OE_HOME_EXT/start.sh" sudo su root -c "echo 'sudo -u $OE_USER $OE_HOME_EXT/openerp-server --config=/etc/${OE_CONFIG}.conf' >> $OE_HOME_EXT/start.sh" @@ -151,16 +175,12 @@ PATH=/bin:/sbin:/usr/bin DAEMON=$OE_HOME_EXT/openerp-server 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 @@ -171,7 +191,6 @@ pid=\`cat \$PIDFILE\` [ -d /proc/\$pid ] && return 0 return 1 } - case "\${1}" in start) echo -n "Starting \${DESC}: " @@ -186,7 +205,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 \ @@ -202,7 +220,6 @@ N=/etc/init.d/\$NAME echo "Usage: \$NAME {start|stop|restart|force-reload}" >&2 exit 1 ;; - esac exit 0 EOF From 39455880c46e2d074f0beee1ff5586f1e61ca9dc Mon Sep 17 00:00:00 2001 From: Yenthe Date: Sun, 24 Apr 2016 17:27:35 +0200 Subject: [PATCH 2/6] Add extra information about the script Add extra information about the script --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 45d6618a..cb0dff8b 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,17 @@ This script can be safely used in a multi-odoo code base server because the defa

Installation procedure

1. Download the script: ``` -sudo wget https://raw.githubusercontent.com/Yenthe666/InstallScript/9.0/odoo_install.sh +sudo wget https://raw.githubusercontent.com/Yenthe666/InstallScript/All/odoo_install.sh ``` -2. Make the script executable: +2. Modify the parameters as you wish. +There are a few things you can configure, this is the most used list:
+```OE_USER``` will be the username for the system user.
+```INSTALL_WKHTMLTOPDF``` set to ```False``` if you do not want to install it, if you want to install it you should set it to ```True```.
+```OE_PORT``` is the port where Odoo should run on, for example 8069.
+```OE_VERSION``` is the Odoo version to install, for example ```9.0``` for Odoo V9.
+```IS_ENTERPRISE``` will install the Enterprise version on top of ```9.0``` if you set it to ```True```, set it to ```False``` if you want the community version of Odoo 9.
+```OE_SUPERADMIN``` is the master password for this Odoo installation.
+3. Make the script executable ``` sudo chmod +x odoo_install.sh ``` From 066c082041930741c6e39cdb1c60c2004afd5a37 Mon Sep 17 00:00:00 2001 From: Yenthe Date: Sun, 24 Apr 2016 17:29:50 +0200 Subject: [PATCH 3/6] Formatting of readme Formatting of readme --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cb0dff8b..fb90bb23 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,11 @@ but goes a bit further. This script will also give you the ability to define an This script can be safely used in a multi-odoo code base server because the default Odoo port is changed BEFORE the Odoo is started.

Installation procedure

-1. Download the script: +- 1. Download the script: ``` sudo wget https://raw.githubusercontent.com/Yenthe666/InstallScript/All/odoo_install.sh ``` -2. Modify the parameters as you wish. +- 2. Modify the parameters as you wish. There are a few things you can configure, this is the most used list:
```OE_USER``` will be the username for the system user.
```INSTALL_WKHTMLTOPDF``` set to ```False``` if you do not want to install it, if you want to install it you should set it to ```True```.
@@ -15,11 +15,11 @@ There are a few things you can configure, this is the most used list:
```OE_VERSION``` is the Odoo version to install, for example ```9.0``` for Odoo V9.
```IS_ENTERPRISE``` will install the Enterprise version on top of ```9.0``` if you set it to ```True```, set it to ```False``` if you want the community version of Odoo 9.
```OE_SUPERADMIN``` is the master password for this Odoo installation.
-3. Make the script executable +- 3. Make the script executable ``` sudo chmod +x odoo_install.sh ``` -3. Execute the script: +- 4. Execute the script: ``` sudo ./odoo_install.sh ``` From 9dc1be4c77db89349a3e91ed370b3ad4bfc7f2fb Mon Sep 17 00:00:00 2001 From: "Yenthe V.G" Date: Tue, 6 Jun 2017 08:23:48 +0200 Subject: [PATCH 4/6] [FIX] Change Wkhtmltopdf download URL (it has moved) --- odoo_install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/odoo_install.sh b/odoo_install.sh index fc028e27..94fa069a 100644 --- a/odoo_install.sh +++ b/odoo_install.sh @@ -38,8 +38,8 @@ OE_CONFIG="${OE_USER}-server" ## === Ubuntu Trusty x64 & x32 === (for other distributions please replace these two links, ## in order to have correct version of wkhtmltox installed, for a danger note refer to ## https://www.odoo.com/documentation/8.0/setup/install.html#deb ): -WKHTMLTOX_X64=http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb -WKHTMLTOX_X32=http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-i386.deb +WKHTMLTOX_X64=https://downloads.wkhtmltopdf.org/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb +WKHTMLTOX_X32=https://downloads.wkhtmltopdf.org/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-i386.deb #-------------------------------------------------- # Update Server From c6fc869ec44e7782b2bd163ae95e1cafe8ec91c7 Mon Sep 17 00:00:00 2001 From: "Yenthe V.G" Date: Wed, 14 Jun 2017 09:30:45 +0200 Subject: [PATCH 5/6] [FIX] Create nodejs symlink after installing nodejs --- odoo_install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/odoo_install.sh b/odoo_install.sh index 94fa069a..b16eaa80 100644 --- a/odoo_install.sh +++ b/odoo_install.sh @@ -112,9 +112,7 @@ sudo git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/odoo $ if [ $IS_ENTERPRISE = "True" ]; then # Odoo Enterprise install! - echo -e "\n--- Create symlink for node" - sudo ln -s /usr/bin/nodejs /usr/bin/node - sudo su $OE_USER -c "mkdir $OE_HOME/enterprise" + sudo su $OE_USER -c "mkdir $OE_HOME/enterprise" sudo su $OE_USER -c "mkdir $OE_HOME/enterprise/addons" echo -e "\n---- Adding Enterprise code under $OE_HOME/enterprise/addons ----" @@ -124,6 +122,9 @@ if [ $IS_ENTERPRISE = "True" ]; then sudo apt-get install nodejs npm sudo npm install -g less sudo npm install -g less-plugin-clean-css + + echo -e "\n--- Create symlink for node" + sudo ln -s /usr/bin/nodejs /usr/bin/node else echo -e "\n---- Create custom module directory ----" sudo su $OE_USER -c "mkdir $OE_HOME/custom" From 9feeb748147af764648e95fa09c95fbe54fdcffd Mon Sep 17 00:00:00 2001 From: Randall Castro Date: Wed, 26 Jul 2017 11:59:07 -0600 Subject: [PATCH 6/6] [FIX] - Fix Markdown format to README.md Fix Markdown format to README.md file --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fb90bb23..5d830e59 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,16 @@ +# [Odoo](https://www.odoo.com "Odoo's Homepage") Install Script + This script is based on the install script from André Schenkels (https://github.com/aschenkels-ictstudio/openerp-install-scripts) but goes a bit further. This script will also give you the ability to define an xmlrpc_port in the .conf file that is generated under /etc/ This script can be safely used in a multi-odoo code base server because the default Odoo port is changed BEFORE the Odoo is started. -

Installation procedure

-- 1. Download the script: +## Installation procedure + +##### 1. Download the script: ``` sudo wget https://raw.githubusercontent.com/Yenthe666/InstallScript/All/odoo_install.sh ``` -- 2. Modify the parameters as you wish. +##### 2. Modify the parameters as you wish. There are a few things you can configure, this is the most used list:
```OE_USER``` will be the username for the system user.
```INSTALL_WKHTMLTOPDF``` set to ```False``` if you do not want to install it, if you want to install it you should set it to ```True```.
@@ -15,11 +18,12 @@ There are a few things you can configure, this is the most used list:
```OE_VERSION``` is the Odoo version to install, for example ```9.0``` for Odoo V9.
```IS_ENTERPRISE``` will install the Enterprise version on top of ```9.0``` if you set it to ```True```, set it to ```False``` if you want the community version of Odoo 9.
```OE_SUPERADMIN``` is the master password for this Odoo installation.
-- 3. Make the script executable + +#### 3. Make the script executable ``` sudo chmod +x odoo_install.sh ``` -- 4. Execute the script: +##### 4. Execute the script: ``` sudo ./odoo_install.sh ```