From dd5aef8ec29a8984917d29d66aa17bfa37aa3fae Mon Sep 17 00:00:00 2001 From: scith Date: Mon, 14 Sep 2015 17:42:46 +0200 Subject: [PATCH] Simpler install --- conf/systemd.service | 19 ------------------- scripts/install | 44 +++++++++++--------------------------------- 2 files changed, 11 insertions(+), 52 deletions(-) delete mode 100644 conf/systemd.service diff --git a/conf/systemd.service b/conf/systemd.service deleted file mode 100644 index 67e267b..0000000 --- a/conf/systemd.service +++ /dev/null @@ -1,19 +0,0 @@ -[Unit] -Description=Advanced OpenSource ERP and CRM server -Requires=postgresql.service -After=postgresql.service -[Install] -Alias=odoo.service -[Service] -Type=simple -PermissionsStartOnly=true -EnvironmentFile=-/etc/odoo-server.conf -User=odoo -Group=odoo -SyslogIdentifier=odoo-server -PIDFile=/run/odoo/odoo-server.pid -ExecStartPre=/usr/bin/install -d -m755 -o odoo -g odoo /run/odoo -ExecStart=/usr/local/bin/odoo-server -c /etc/odoo-server.conf --pid=/run/odoo/odoo-server.pid --syslog $OPENERP_ARGS -ExecStop=/bin/kill $MAINPID -[Install] -WantedBy=multi-user.target \ No newline at end of file diff --git a/scripts/install b/scripts/install index b94e3f3..0cc1518 100644 --- a/scripts/install +++ b/scripts/install @@ -23,45 +23,23 @@ domain=${domain%/} sudo yunohost app setting $app domain -v $domain # Install Odoo - # Install postgresql and create user - sudo apt-get install postgresql -y - sudo su - postgres -c "createuser -s odoo" 2> /dev/null || true + # Prepare installation + sudo apt-get -y install curl - # Install Odoo dependencies - sudo apt-get install python-dateutil python-feedparser python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-docutils python-psutil python-mock python-unittest2 python-jinja2 python-pypdf python-decorator python-requests git-core python-passlib -y - sudo pip install gdata - - # Install wkhtopdf to print PDF reports - wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-jessie-amd64.deb - sudo dpkg -i wkhtmltox-0.12.2.1_linux-jessie-amd64.deb - sudo apt-get install -y xfonts-75dpi - sudo cp /usr/local/bin/wkhtmltopdf /usr/bin - sudo cp /usr/local/bin/wkhtmltoimage /usr/bin - - # Create odoo user - sudo adduser --system --quiet --shell=/bin/bash --home=/home/odoo --gecos 'ODOO' --group odoo - # Install Odoo - sudo git clone --branch $odoo_version https://www.github.com/odoo/odoo /opt/odoo/ - sudo chown -R odoo:odoo /opt/odoo - - # Create log file - sudo mkdir /var/log/odoo - sudo chown -R odoo:odoo /var/log/odoo + sudo curl -sS https://nightly.odoo.com/odoo.key | sudo apt-key add - + sudo sh -c 'echo "deb http://nightly.odoo.com/$odoo_version/nightly/deb/ ./" > /etc/apt/sources.list.d/odoo.list' + sudo apt-get update + sudo apt-get -y install wkhtmltopdf + sudo apt-get -y install odoo - # Create conf file + # Copy conf file sudo sed -i "s@ADMIN_PASSWORD@$admin_password@g" ../conf/odoo-server.conf sudo cp ../conf/odoo-server.conf /etc/odoo-server.conf - sudo chown odoo:odoo /etc/odoo-server.conf - # Systemd and services - # if [ -d /run/systemd/system ]; then - # sudo systemctl enable postgresql.service - # sudo cp ../conf/systemd.service /etc/systemd/system/odoo.service - # sudo systemctl enable odoo.service - # fi - # sudo yunohost service add postgresql - # sudo yunohost service add odoo + # Add services + sudo yunohost service add postgresql + sudo yunohost service add odoo # Configure Nginx and reload sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf