-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_odoo.sh
executable file
·99 lines (84 loc) · 2.85 KB
/
install_odoo.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
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
#!/bin/sh
# usage: ./install_plone.sh
$AS_VAGRANT=sudo -u vagrant
sudo apt-get install -y git-core
sudo apt-get install -y python-pip
sudo apt-get install -y python-dev
sudo apt-get install -y libxml2-dev libxslt-dev
sudo apt-get install -y postgresql
sudo apt-get install -y python-psycopg2
sudo apt-get install -y libpq-dev
sudo apt-get install -y libldap2-dev libsasl2-dev libssl-dev
sudo apt-get install python-virtualenv
sudo -u postgres createuser vagrant --superuser
echo "DONE!"
echo "Ready to install Odoo !"
export HOME=/home/vagrant/
cd /home/vagrant/odoo
$AS_VAGRANT mkdir instance-70
$AS_VAGRANT mkdir instance-70/log
$AS_VAGRANT mkdir instance-80
$AS_VAGRANT mkdir instance-80/log
CWD=`pwd`
cd ./instance-70
$AS_VAGRANT ln -s ../buildout-70.cfg buildout.cfg
cd $CWD
cd ./instance-80
$AS_VAGRANT ln -s ../buildout-80.cfg buildout.cfg
cd $CWD
$AS_VAGRANT virtualenv instance-70
$AS_VAGRANT ./instance-70/bin/pip install zc.buildout
$AS_VAGRANT virtualenv instance-80
$AS_VAGRANT ./instance-80/bin/pip install zc.buildout
CWD=`pwd`
cd instance-70
$AS_VAGRANT ./bin/buildout -vvv
cd $CWD
if [ ! -f ./instance-70/bin/start_openerp ]
then
echo "Instance 7.0 creation error. Please restart them"
exit 1
fi
cd instance-80
$AS_VAGRANT ./bin/buildout -vvv
cd $CWD
if [ ! -f ./instance-80/bin/start_openerp ]
then
echo "Instance 8.0 creation error. Please restart them"
exit 1
fi
if [ ! -f /etc/init/odoo-server-70.conf ]
then
sudo rm /etc/init/odoo-server-70.conf
fi
if [ ! -L /etc/init.d/odoo-server-70 ]
then
sudo rm /etc/init.d/odoo-server-70
fi
sudo touch /etc/init/odoo-server-70.conf
echo "setuid vagrant" | sudo tee /etc/init/odoo-server-70.conf
echo "setgid vagrant" | sudo tee -a /etc/init/odoo-server-70.conf
echo "start on filesystem or runlevel[45]" | sudo tee -a /etc/init/odoo-server-70.conf
echo "stop on runlevel[!45]" | sudo tee -a /etc/init/odoo-server-70.conf
echo "exec /home/vagrant/odoo/instance-70/bin/start_openerp --proxy-mode" | sudo tee -a /etc/init/odoo-server-70.conf
sudo ln -s /lib/init/upstart-job /etc/init.d/odoo-server-70
sudo service odoo-server-70 restart
if [ ! -f /etc/init/odoo-server-80.conf ]
then
sudo rm /etc/init/odoo-server-80.conf
fi
if [ ! -L /etc/init.d/odoo-server-80 ]
then
sudo rm /etc/init.d/odoo-server-80
fi
sudo touch /etc/init/odoo-server-80.conf
echo "setuid vagrant" | sudo tee /etc/init/odoo-server-80.conf
echo "setgid vagrant" | sudo tee -a /etc/init/odoo-server-80.conf
echo "start on filesystem or runlevel[45]" | sudo tee -a /etc/init/odoo-server-80.conf
echo "stop on runlevel[!45]" | sudo tee -a /etc/init/odoo-server-80.conf
echo "exec /home/vagrant/odoo/instance-80/bin/start_openerp --proxy-mode" | sudo tee -a /etc/init/odoo-server-80.conf
sudo ln -s /lib/init/upstart-job /etc/init.d/odoo-server-80
sudo service odoo-server-80 restart
echo
echo "DONE!"
echo "You may now run Odoo instance 7.0 or 8.0."