mirror of
https://github.com/YunoHost-Apps/garradin_ynh.git
synced 2024-09-03 18:36:17 +02:00
Fix change_url and add test cases for upgrade
This commit is contained in:
parent
92b105e43d
commit
441755d9fb
2 changed files with 11 additions and 10 deletions
|
@ -12,6 +12,8 @@
|
|||
setup_public=1
|
||||
upgrade=1
|
||||
upgrade=1 from_commit=7205455e0a806a49c48c6d2f005d80d1b74a3355
|
||||
upgrade=1 from_commit=fc55308f7521310d5c339139339896bb59bd73cd
|
||||
upgrade=1 from_commit=e5dd30afa6a618344c9e7b927839d4e9ac8bfc56
|
||||
backup_restore=1
|
||||
multi_instance=1
|
||||
change_url=1
|
||||
|
@ -20,5 +22,11 @@ Email=
|
|||
Notification=none
|
||||
;;; Upgrade options
|
||||
; commit=7205455e0a806a49c48c6d2f005d80d1b74a3355
|
||||
name=Merge pull request #55 from yunohost-bot/issue-and-pr-template
|
||||
name=Previous version
|
||||
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&
|
||||
; commit=fc55308f7521310d5c339139339896bb59bd73cd
|
||||
name=Version 0.9.5
|
||||
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&
|
||||
; commit=e5dd30afa6a618344c9e7b927839d4e9ac8bfc56
|
||||
name=Version 1.0.3~ynh2
|
||||
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&
|
||||
|
|
|
@ -20,6 +20,7 @@ new_domain=$YNH_APP_NEW_DOMAIN
|
|||
new_path=$YNH_APP_NEW_PATH
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
secret_key=$(ynh_string_random --length=50)
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
|
@ -81,15 +82,7 @@ then
|
|||
path_url="$new_path"
|
||||
# Create a dedicated NGINX config
|
||||
ynh_add_nginx_config
|
||||
fi
|
||||
|
||||
# change the config.local.conf
|
||||
if [ $change_path -eq 1 ] && [ "$new_path" == "/" ]; then
|
||||
ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path';" --target_file="$final_path/config.local.php"
|
||||
elif [ $change_path -eq 1 ] && [ "$old_path" == "/" ]; then
|
||||
ynh_replace_string --match_string="const WWW_URI = '$old_path';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php"
|
||||
elif [ $change_path -eq 1 ]; then
|
||||
ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php"
|
||||
ynh_add_config --template="config.local.yunohost.php" --destination="$final_path/config.local.yunohost.php"
|
||||
fi
|
||||
|
||||
# Change the domain for NGINX
|
||||
|
|
Loading…
Reference in a new issue