2015-09-14 17:12:17 +02:00
|
|
|
#!/bin/bash
|
2017-05-18 23:28:18 +02:00
|
|
|
|
2016-07-05 15:22:12 +02:00
|
|
|
set -eu
|
|
|
|
|
|
|
|
# Source YunoHost helpers
|
2017-05-18 23:28:18 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
source _future.sh
|
|
|
|
source _common.sh
|
|
|
|
|
|
|
|
ynh_trap_on
|
2016-07-05 15:22:12 +02:00
|
|
|
|
|
|
|
# Retrieve arguments
|
2017-05-18 23:28:18 +02:00
|
|
|
export app=$YNH_APP_INSTANCE_NAME
|
|
|
|
export domain=$(ynh_app_setting_get "$app" domain)
|
|
|
|
export odoo_version=$(ynh_app_setting_get "$app" odoo_version)
|
|
|
|
export is_master=$(ynh_app_setting_get "$app" is_master)
|
|
|
|
export oca=$(ynh_app_setting_get "$app" oca)
|
|
|
|
export port=$(ynh_app_setting_get $app port)
|
|
|
|
export is_public=0
|
|
|
|
|
|
|
|
version=$(ynh_read_json "/etc/yunohost/apps/$app/manifest.json" 'version' 2> /dev/null || echo '9.0-0')
|
|
|
|
last_version=$(ynh_read_manifest 'version')
|
|
|
|
|
|
|
|
#ynh_exit_if_up_to_date
|
|
|
|
ynh_check_var "$app" "app name not set"
|
2015-09-14 17:12:17 +02:00
|
|
|
|
2015-09-14 18:13:54 +02:00
|
|
|
# Upgrade official package
|
2017-05-18 23:28:18 +02:00
|
|
|
apt-get install odoo -y -qq
|
|
|
|
|
|
|
|
# Zamentur version https://github.com/zamentur/odoo_ynh/commit/cdeb9afbf218431781f752dedfbf4247afbd5b44
|
|
|
|
if [ "${version}" = "9.0-0" ]; then
|
|
|
|
# set new args
|
|
|
|
odoo_version=${odoo_version:-$(ynh_app_setting_get "$app" version)}
|
|
|
|
if [ "$is_master" = "" ]; then
|
|
|
|
if [ "$(ynh_app_setting_get "$app" instance)" = "master" ];then
|
|
|
|
is_master="true"
|
|
|
|
else
|
|
|
|
is_master="false"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
port=${port:-8069}
|
|
|
|
oca=${oca:-false}
|
|
|
|
ynh_save_args odoo_version oca is_master port
|
|
|
|
|
|
|
|
# Install official debian package
|
|
|
|
install_dependencies
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${version}" = "10.0-1" ]; then
|
|
|
|
# Put here your migrations
|
|
|
|
echo ""
|
|
|
|
fi
|
|
|
|
|
2016-07-05 15:22:12 +02:00
|
|
|
|