From 2ed02fbcc878a97c26c1c39e2aae8b81a361ce20 Mon Sep 17 00:00:00 2001 From: Brian Dunnette Date: Sun, 29 Dec 2013 16:44:13 -0600 Subject: [PATCH] initial script (only works on debian/ubuntu for now) --- .gitignore | 6 ++++++ install-openerp.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) mode change 100644 => 100755 install-openerp.py diff --git a/.gitignore b/.gitignore index ded6067..7f24ad6 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,9 @@ nosetests.xml .mr.developer.cfg .project .pydevproject + +# Downloaded packages +*.deb +*.rpm +*.exe +*.tar.gz diff --git a/install-openerp.py b/install-openerp.py old mode 100644 new mode 100755 index 4265cc3..a2e4302 --- a/install-openerp.py +++ b/install-openerp.py @@ -1 +1,29 @@ #!/usr/bin/env python +# Thanks to Alan Lord for his OpenERP-on-Ubuntu tips: http://www.theopensourcerer.com/2012/12/how-to-install-openerp-7-0-on-ubuntu-12-04-lts/ +import argparse +import urllib +import platform +import subprocess + +system = platform.system().lower() +print system + +if system == "linux": + distro = platform.linux_distribution()[0].lower() + print "%s distro: %s" % (system, distro) + +if distro: + if distro in ['ubuntu', 'debian']: + url = "http://nightly.openerp.com/7.0/nightly/deb/openerp_7.0-latest-1_all.deb" + filename = "openerp_7.0-latest-1_all.deb" + else: + print "Sorry, we don't have an automated install for %s yet!" % distro + +print "downloading %s" % url +urllib.urlretrieve(url, filename) +subprocess.call("sudo apt-get -y install postgresql", shell=True) +subprocess.call("sudo dpkg -i %s" % filename, shell=True) +subprocess.call("sudo apt-get -f -y install", shell=True) +print "Creating OpenERP Postgres user" +subprocess.call("sudo -u postgres createuser --createdb --no-createrole --no-superuser --pwprompt openerp", shell=True) +