mirror of
https://github.com/YunoHost-Apps/paheko_ynh.git
synced 2024-09-03 19:56:22 +02:00
sripts modified, try to resolve change url
This commit is contained in:
parent
d327d07ca3
commit
6d98d6dcb3
2 changed files with 39 additions and 8 deletions
|
@ -22,13 +22,38 @@ new_path=$YNH_APP_NEW_PATH
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK THE SYNTAX OF THE PATHS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Loading installation settings..." --time --weight=1
|
||||||
|
|
||||||
test -n "$old_path" || old_path="/"
|
# Needed for helper "ynh_add_nginx_config"
|
||||||
test -n "$new_path" || new_path="/"
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
new_path=$(ynh_normalize_url_path $new_path)
|
|
||||||
old_path=$(ynh_normalize_url_path $old_path)
|
#=================================================
|
||||||
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." --time --weight=1
|
||||||
|
|
||||||
|
# Backup the current version of the app
|
||||||
|
ynh_backup_before_upgrade
|
||||||
|
ynh_clean_setup () {
|
||||||
|
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
|
||||||
|
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
||||||
|
|
||||||
|
# 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 SYNTAX OF THE PATHS
|
||||||
|
# #=================================================
|
||||||
|
|
||||||
|
# test -n "$old_path" || old_path="/"
|
||||||
|
# test -n "$new_path" || new_path="/"
|
||||||
|
# new_path=$(ynh_normalize_url_path $new_path)
|
||||||
|
# old_path=$(ynh_normalize_url_path $old_path)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK WHICH PARTS SHOULD BE CHANGED
|
# CHECK WHICH PARTS SHOULD BE CHANGED
|
||||||
|
@ -82,7 +107,7 @@ then
|
||||||
ynh_delete_file_checksum --file="$nginx_conf_path"
|
ynh_delete_file_checksum --file="$nginx_conf_path"
|
||||||
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
|
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
|
||||||
# Store file checksum for the new config file location
|
# Store file checksum for the new config file location
|
||||||
#ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -46,6 +46,12 @@ elif [ "$is_public" = "No" ]; then
|
||||||
is_public=0
|
is_public=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If final_path doesn't exist, create it
|
||||||
|
if [ -z "$final_path" ]; then
|
||||||
|
final_path=/var/www/$app
|
||||||
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# Backup squlite, config.local.php and squelettes directory
|
# Backup squlite, config.local.php and squelettes directory
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -148,9 +154,9 @@ then
|
||||||
else
|
else
|
||||||
ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php"
|
ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php"
|
||||||
fi
|
fi
|
||||||
#=================================================
|
#=======================================================
|
||||||
# backup bdd, squelettes directory and config.local.php
|
# backup bdd, squelettes directory and config.local.php
|
||||||
#=================================================
|
#=======================================================
|
||||||
ynh_script_progression --message="restore data..." --time --weight=1
|
ynh_script_progression --message="restore data..." --time --weight=1
|
||||||
|
|
||||||
backup_bdd=/tmp/association.sqlite
|
backup_bdd=/tmp/association.sqlite
|
||||||
|
|
Loading…
Add table
Reference in a new issue