[fix] Export bin_file

This commit is contained in:
ljf 2018-05-21 15:44:09 +02:00
parent b8002d0e67
commit 94b2b28db1
3 changed files with 52 additions and 14 deletions

5
conf/openupgrade.src Normal file
View file

@ -0,0 +1,5 @@
SOURCE_URL=https://raw.githubusercontent.com/OCA/OpenUpgrade/11.0/scripts/migrate.py
SOURCE_SUM=362c8cf9b43a3aaddb440e642205e9596da78e28d1e47b582612ced671d95e0b
SOURCE_FILE=odoo-migrate-11.py
SOURCE_SUM_PRG=sha256sum
SOURCE_EXTRACT=False

View file

@ -13,11 +13,11 @@ function define_paths() {
export source_path=/usr/lib/python2.7/dist-packages/odoo/ export source_path=/usr/lib/python2.7/dist-packages/odoo/
fi fi
export conf_file=/etc/odoo/odoo.conf export conf_file=/etc/odoo/odoo.conf
bin_file=/usr/bin/odoo export bin_file=/usr/bin/odoo
else else
export source_path=/usr/lib/python2.7/dist-packages/openerp/ export source_path=/usr/lib/python2.7/dist-packages/openerp/
export conf_file=/etc/odoo/openerp-server.conf export conf_file=/etc/odoo/openerp-server.conf
bin_file=/usr/bin/openerp-server export bin_file=/usr/bin/openerp-server
fi fi
} }

View file

@ -1,13 +1,19 @@
#!/bin/bash #!/bin/bash
set -eu #=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# Source YunoHost helpers # Source YunoHost helpers
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
source _future.sh source _future.sh
source _common.sh source _common.sh
ynh_trap_on #=================================================
# LOAD SETTINGS
#=================================================
# Retrieve arguments # Retrieve arguments
export app=$YNH_APP_INSTANCE_NAME export app=$YNH_APP_INSTANCE_NAME
@ -17,18 +23,40 @@ export is_master=$(ynh_app_setting_get "$app" is_master)
export oca=$(ynh_app_setting_get "$app" oca) export oca=$(ynh_app_setting_get "$app" oca)
export port=$(ynh_app_setting_get $app port) export port=$(ynh_app_setting_get $app port)
export is_public=0 export is_public=0
export major_upgrade=$(ynh_app_setting_get $app major_upgrade)
version=$(ynh_read_json "/etc/yunohost/apps/$app/manifest.json" 'version' 2> /dev/null || echo '9.0-0') #=================================================
last_version=$(ynh_read_manifest 'version') # CHECK VERSION
#=================================================
#ynh_exit_if_up_to_date ynh_abort_if_up_to_date
ynh_check_var "$app" "app name not set"
# Upgrade official package #=================================================
apt-get install odoo -y -qq # STANDARD UPGRADE STEPS
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# CHECK THE PATH
#=================================================
path_url=$(ynh_normalize_url_path $path_url) # Vérifie et corrige la syntaxe du path.
#=================================================
# STEP Migrations
#=================================================
# Zamentur version https://github.com/zamentur/odoo_ynh/commit/cdeb9afbf218431781f752dedfbf4247afbd5b44 # Zamentur version https://github.com/zamentur/odoo_ynh/commit/cdeb9afbf218431781f752dedfbf4247afbd5b44
if [ "${version}" = "9.0-0" ]; then if ynh_version_le "9.0-0" ; then
# set new args # set new args
odoo_version=${odoo_version:-$(ynh_app_setting_get "$app" version)} odoo_version=${odoo_version:-$(ynh_app_setting_get "$app" version)}
if [ "$is_master" = "" ]; then if [ "$is_master" = "" ]; then
@ -46,9 +74,14 @@ if [ "${version}" = "9.0-0" ]; then
install_dependencies install_dependencies
fi fi
if [ "${version}" = "10.0-1" ]; then if ynh_version_le "11.0-1" ; then
# Put here your migrations # By default we don't upgrade to major version
echo "" major_upgrade=${major_upgrade:-0}
ynh_save_args major_upgrade
fi fi
# Upgrade official package
apt-get install odoo -y -qq