forked from ventor-tech/odoo-install-script
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathodoo.sh
More file actions
126 lines (102 loc) · 3.98 KB
/
odoo.sh
File metadata and controls
126 lines (102 loc) · 3.98 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/bin/bash
# shellcheck source=wkhtmltox.sh
# shellcheck source=odoocalculatos.sh
#--------------------------------------------------
# Install Dependencies
#--------------------------------------------------
if [ $OE_VERSION = "10.0" ] || [ $OE_VERSION = "11.0" ] || [ $OE_VERSION = "12.0" ] || [ $OE_VERSION = "13.0" ] || [ $OE_VERSION = "14.0" ] || [ $OE_VERSION = "15.0" ]; then
OE_BIN="odoo-bin"
else
OE_BIN="openerp-server"
fi
echo -e "\n---- Python Dependencies ----"
if [ $PYTHON_VERSION = "3" ]; then
#----------------- Python 3 ------------------
if [ $(which python3.6) ] || [ $(which python3.7) ] || [ $(which python3.8) ] || [ $(which python3.9) ]; then
sudo apt-get install -y python3-pip python3-dev python3-setuptools python3-venv
else
echo "System has wrong python version! Odoo supports only 3.6+ python"
exit 1
fi
else
#------------------ Python 2 -------------------
sudo apt-get install -y python-dev python-virtualenv python-setuptools python-pip
fi
echo -e "\n---- Odoo Web Dependencies ----"
sudo apt-get install -y nodejs npm
sudo apt-get install -y node-less node-clean-css
sudo npm install -g less less-plugin-clean-css
#--------------------------------------------------
# Install Wkhtmltopdf if needed
#--------------------------------------------------
source wkhtmltox.sh
# INSTALL_WKHTMLTOPDF_VERSION=`wkhtmltopdf --version`
# if [ $INSTALL_WKHTMLTOPDF = "True" ] && [ -z "$INSTALL_WKHTMLTOPDF_VERSION" ]; then
# echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO $OE_VERSION ----"
#
# OS_RELEASE=`lsb_release -sc`
# if [ "`getconf LONG_BIT`" == "64" ];then
# _url=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1."$OS_RELEASE"_amd64.deb
# else
# _url=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1."$OS_RELEASE"_i386.deb
# fi
# wget $_url
# sudo dpkg -i `basename $_url`
# sudo apt-get install -f -y
# else
# echo "Wkhtmltopdf isn't installed due to the choice of the user!"
# fi
echo -e "\n---- Create Log directory ----"
mkdir -p $OE_LOG_PATH
#--------------------------------------------------
# Install ODOO
#--------------------------------------------------
# Make ODOO dir infrastucture
mkdir -p $OE_INSTALL_DIR
mkdir -p $OE_WORKSPACE
mkdir -P $OE_INSTANCES
mkdir -p $OE_GIT
if [ ! -d "$OE_REPO" ]; then
echo -e "\n==== Installing ODOO Server ===="
git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/odoo $OE_REPO/
fi
if [ ! -d "$OE_INSTANCES/$OE_VERSION/env" ]; then
echo -e "* Create virtualenv"
if [ $PYTHON_VERSION = "3" ]; then
python3 -m venv $OE_INSTANCES/venv
else
virtualenv $OE_INSTANCES/venv
fi
fi
source $OE_INSTANCES/venv/bin/activate
sudo apt-get install libicu-dev libpq-dev libxml2-dev libxslt1-dev libsasl2-dev libldap2-dev libssl-dev zlib1g-dev -y
pip install --upgrade pip
if [[ -f $OE_REPO/requirements.txt ]]; then
echo "Installing from $OE_REPO/requirements.txt with pip."
if [ $PYTHON_VERSION = "3" ]; then
pip3 install -r $OE_REPO/requirements.txt
else
pip install -r $OE_REPO/requirements.txt
fi
fi
if [ $IS_ENTERPRISE = "True" ]; then
if [ ! -d "$OE_INSTALL_DIR/enterprise/addons" ]; then
# Odoo Enterprise install!
mkdir -p $OE_INSTALL_DIR/enterprise/addons
echo -e "\n---- Adding Enterprise code under $OE_HOME/enterprise/addons ----"
git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/enterprise "$OE_INSTALL_DIR/enterprise/addons"
fi
fi
if [ ! -d "$OE_SRC/all_addons" ]; then
echo -e "\n---- Create custom module directory ----"
mkdir -p $OE_SRC/all_addons
fi
source odoocalculator.sh
if [ ! -f "$OE_CONFIG" ]; then
echo -e "* Create server config file"
source odoo_conf.sh
fi
if [[ $EUID -eq 0 ]]; then
echo -e "\n---- Setting permissions on home folder as we are executing script as a root----"
chown -R $OE_USER:$OE_USER $OE_HOME
fi