forked from Yenthe666/InstallScript
-
Notifications
You must be signed in to change notification settings - Fork 2
/
odoo_install_production.sh
executable file
·56 lines (46 loc) · 2.27 KB
/
odoo_install_production.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
################################################################################
# Script for installing Odoo on Ubuntu 14.04, 15.04, 16.04 and 18.04 (could be used for other version too)
# Author: Yenthe Van Ginneken
#-------------------------------------------------------------------------------
# This script will install Odoo on your Ubuntu 16.04 server. It can install multiple Odoo instances
# in one Ubuntu because of the different xmlrpc_ports
#-------------------------------------------------------------------------------
################################################################################
. ./env_var.sh
./odoo_install_debian_dependancy.sh
echo -e "\n---- Create ODOO system user ----"
sudo adduser --system --quiet --shell=/bin/bash --home=/${OE_USER} --gecos 'ODOO' --group ${OE_USER}
#The user should also be added to the sudo'ers group.
sudo adduser ${OE_USER} sudo
echo -e "\n---- Creating the ODOO PostgreSQL User ----"
sudo su - postgres -c "createuser -s ${OE_USER}" 2> /dev/null || true
#echo -e "\n---- Create Log directory ----"
#sudo mkdir /var/log/${OE_USER}
#sudo chown ${OE_USER}:${OE_USER} /var/log/${OE_USER}
echo -e "\n---- Setting permissions on home folder ----"
sudo mkdir -p ${OE_HOME}
sudo chown -R ${OE_USER}:${OE_USER} ${OE_HOME}
#--------------------------------------------------
# Install ODOO
#--------------------------------------------------
echo -e "\n==== Clone this installation ===="
REMOTE_URL_GIT=`git remote get-url origin`
BRANCH_GIT=`git rev-parse --abbrev-ref HEAD`
sudo su ${OE_USER} -c "git clone --branch ${BRANCH_GIT} ${REMOTE_URL_GIT} ${OE_HOME_ODOO}"
sudo cp ./env_var.sh ${OE_HOME_ODOO}
sudo chown -R ${OE_USER}:${OE_USER} ${OE_HOME_ODOO}/env_var.sh
LAST_PWD=$PWD
cd ${OE_HOME_ODOO}
sudo su ${OE_USER} -c "./odoo_install_locally.sh"
cd ${LAST_PWD}
#echo -e "\n* Updating server config file"
#sudo su ${OE_USER} -c "printf 'logfile = /var/log/${OE_USER}/${OE_CONFIG}.log\n' >> /${OE_USER}/odoo/config.conf"
#--------------------------------------------------
# Adding ODOO as a daemon
#--------------------------------------------------
./odoo_install_daemon.sh
#--------------------------------------------------
# Install Nginx if needed
#--------------------------------------------------
./odoo_install_production_nginx.sh