Multi-instances

This commit is contained in:
scith 2015-09-16 10:17:50 +02:00
parent 334c4c652c
commit 2aed2b628f
3 changed files with 38 additions and 12 deletions

View file

@ -12,7 +12,7 @@ https://example.com/odoo/ will NOT work
What does not work What does not work
------------------ ------------------
- Backup and restore - Backup and restore via YunoHost
- Automatic database creation - Automatic database creation
- Automatic LDAP configuration - Automatic LDAP configuration
@ -31,6 +31,10 @@ Configuration
- Template user: template - Template user: template
- Save - Save
**Backup and Restore via Odoo**
- In YunoHost, open the port 8069
- Access Odoo via your server's IP or URL via *:8069* at the end. You can now backup and restore via the web interface
Odoo Odoo
---- ----

View file

@ -7,10 +7,6 @@ domain=$1
odoo_version=$2 odoo_version=$2
admin_password=$3 admin_password=$3
sudo yunohost app checkport 8069
if [[ ! $? -eq 0 ]]; then
exit 1
fi
# Check domain/path availability # Check domain/path availability
domain=${domain}"/" domain=${domain}"/"
@ -21,7 +17,20 @@ sudo yunohost app checkurl $domain -a $app \
domain=${domain%/} domain=${domain%/}
sudo yunohost app setting $app domain -v $domain sudo yunohost app setting $app domain -v $domain
# Install Odoo if [ -f /usr/bin/openerp-server ]; then
echo "Odoo is already installed, switching to multi-instances"
sudo yunohost app setting $app instance -v "slave"
else
sudo yunohost app checkport 8069
if [[ ! $? -eq 0 ]]; then
exit 1
fi
echo "Installing odoo"
sudo yunohost app setting $app version -v $odoo_version
sudo yunohost app setting $app instance -v "master"
# Install Odoo
# Prepare installation # Prepare installation
sudo apt-get -y -qq install curl sudo apt-get -y -qq install curl
@ -56,6 +65,10 @@ sudo yunohost app setting $app domain -v $domain
sudo yunohost service add odoo sudo yunohost service add odoo
sudo yunohost service stop odoo sudo yunohost service stop odoo
sudo yunohost service start odoo sudo yunohost service start odoo
fi
# Setup database: TO BE DONE
# Setup LDAP: TO BE DONE
# Configure Nginx and reload # Configure Nginx and reload
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf

View file

@ -1,13 +1,22 @@
#!/bin/bash #!/bin/bash
app=odoo app=odoo
domain=$(sudo yunohost app setting $app domain)
instance=$(sudo yunohost app setting $app instance)
# Remove Odoo # If removing master instance, remove Odoo. Else, remove database only
sudo apt-get remove odoo -y if [ "$instance" = "master" ]; then
sudo apt-get remove wkhtmltopdf -y # Remove Odoo
sudo yunohost service remove odoo sudo yunohost service stop odoo
sudo yunohost service stop postgresql
sudo apt-get remove odoo -y
sudo apt-get remove wkhtmltopdf -y
sudo yunohost service remove odoo
sudo yunohost service remove postgresql
else
# Remove database: TO BE DONE
fi
# Remove NGINX conf # Remove NGINX conf
domain=$(sudo yunohost app setting $app domain)
sudo rm /etc/nginx/conf.d/$domain.d/$app.conf sudo rm /etc/nginx/conf.d/$domain.d/$app.conf
# Reload # Reload