Skip to content

Instantly share code, notes, and snippets.

@dreispt
Created January 10, 2013 00:04
Show Gist options
  • Save dreispt/4498183 to your computer and use it in GitHub Desktop.
Save dreispt/4498183 to your computer and use it in GitHub Desktop.
OpenERP install script
#--------------------------------------------
#install PostgreSQL
yes | sudo apt-get install postgresql
#install Python dependencies
yes | sudo apt-get install python-dateutil python-docutils python-feedparser \
python-gdata python-jinja2 python-ldap python-libxslt1 python-lxml python-mako \
python-mock python-openid python-psycopg2 python-psutil python-pybabel \
python-pychart python-pydot python-pyparsing python-reportlab python-simplejson \
python-tz python-unittest2 python-vatnumber python-vobject python-webdav \
python-werkzeug python-xlwt python-yaml python-zsi
#install GDATA
wget http://gdata-python-client.googlecode.com/files/gdata-2.0.17.tar.gz
tar zxvf gdata-2.0.17.tar.gz
cd gdata-2.0.17/
python setup.py install
cd ..
#install bazaar
yes | sudo apt-get install bzr
yes | sudo apt-get install bzrtools
#--------------------------------------------
#create the install directory for OpenERP
sudo adduser --system --quiet --shell=/bin/bash --home=/opt/openerp --gecos 'OpenERP' --group openerp
sudo mkdir /var/log/openerp
sudo chown openerp:root /var/log/openerp
#--------------------------------------------
INSTANCE = "test"
#create a postgres user for OpenERP
sudo su - postgres
createuser --createdb --username openerp-$INSTANCE --no-createrole --no-superuser
exit
#install the three OpenERP branches
#wget http://nightly.openerp.com/7.0/nightly/src/openerp-7.0-latest.tar.gz
#sudo tar xvf ~/openerp-7.0-latest.tar.gz
mkdir /opt/openerp/$INSTANCE
bzr co lp:openerp-web/7.0 /opt/openerp/$INSTANCE/web
bzr co lp:openobject-server/7.0 /opt/openerp/$INSTANCE/server
bzr co lp:openobject-addons/7.0 /opt/openerp/$INSTANCE/addons
#setup configuration file
sudo cp /opt/openerp/$INSTANCE/server/install/openerp-server.conf /opt/openerp/$INSTANCE
#sudo chown ubuntu: /etc/openerp-server.conf
#sudo chmod 640 /etc/openerp-server.conf
sudo sed -i'' 's/db_user = .*/db_user = openerp-$INSTANCE/g' /opt/openerp/$INSTANCE/openerp-server.conf
sudo echo "logfile = /var/log/openerp/openerp-$INSTANCE.log" >> /opt/openerp/$INSTANCE/openerp-server.conf
sudo echo "addons_path=/opt/openerp/$INSTANCE/addons,/opt/openerp/$INSTANCE/web/addons" >> /opt/openerp/$INSTANCE/openerp-server.conf
echo "
#!/bin/sh
sudo su - openerp /opt/openerp/$INSTANCE/server/server/openerp-server --config=/opt/openerp/$INSTANCE/openerp-server.conf $*
" >> /opt/openerp/$INSTANCE/start.sh
sudo chmod 755 /opt/openerp/$INSTANCE/start.sh
#setup auto-startup
#cd /etc/init.d
#sudo curl -O http://174.129.226.169/openerp_config/openerp-server
#sudo sed -i'' 's/USER=.*/USER=ubuntu/g' /etc/init.d/openerp-server
#sudo chmod 755 /etc/init.d/openerp-server
#sudo chown root: /etc/init.d/openerp-server
#sudo update-rc.d openerp-server defaults
#sudo /etc/init.d/openerp-server start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment