libreerp_ynh/scripts/upgrade
2017-05-18 23:28:18 +02:00

54 lines
1.4 KiB
Bash

#!/bin/bash
set -eu
# Source YunoHost helpers
source /usr/share/yunohost/helpers
source _future.sh
source _common.sh
ynh_trap_on
# Retrieve arguments
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"
# Upgrade official package
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