mirror of
https://github.com/YunoHost-Apps/flarum_ynh.git
synced 2024-09-03 18:36:24 +02:00
Merge pull request #109 from YunoHost-Apps/upgrade
Upgrade to version 0.1.0-beta.7.2
This commit is contained in:
commit
2fef7b7dbd
2 changed files with 19 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
||||||
# Version numbers
|
# Version numbers
|
||||||
flarum_version="0.1.0-beta.7.1"
|
flarum_version="0.1.0-beta.7.2"
|
||||||
ssowat_ext_ver="0.6"
|
ssowat_ext_ver="0.6"
|
||||||
|
|
||||||
# Execute a command as another user
|
# Execute a command as another user
|
||||||
|
|
|
@ -114,15 +114,21 @@ fi
|
||||||
# Downward compatibility: remove the v before version number
|
# Downward compatibility: remove the v before version number
|
||||||
if [[ $old_flarum_version == "v*" ]]; then $old_flarum_version = ${old_flarum_version:1}; fi
|
if [[ $old_flarum_version == "v*" ]]; then $old_flarum_version = ${old_flarum_version:1}; fi
|
||||||
# Check if upgrade of Flarum core is needed
|
# Check if upgrade of Flarum core is needed
|
||||||
if [[ $(dpkg --compare-versions $old_flarum_version lt $flarum_version) ]]; then
|
if [[ $(dpkg --compare-versions $old_flarum_version lt $flarum_version && echo true) ]]; then
|
||||||
# Upgrade Flarum
|
# Upgrade Flarum
|
||||||
exec_composer $app $final_path "require -n flarum/core:'$flarum_version'"
|
exec_composer $app $final_path "require -n flarum/core:$flarum_version"
|
||||||
|
# Database password has to be input on admin page after upgrade to 0.1.0-beta.7.2
|
||||||
|
if [[ $flarum_version == "0.1.0-beta.7.2" ]]; then
|
||||||
|
curl "https://$domain$path_url/admin" -H "Accept: */*" --compressed -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" --data "databasePassword=$db_pwd" -k
|
||||||
|
fi
|
||||||
pushd $final_path
|
pushd $final_path
|
||||||
exec_as $app php flarum cache:clear
|
exec_as $app php flarum cache:clear
|
||||||
popd
|
popd
|
||||||
ynh_print_info "Flarum has been updated to version $flarum_version."
|
ynh_print_info "Flarum has been updated to version $flarum_version."
|
||||||
|
upgraded_flarum=true
|
||||||
else
|
else
|
||||||
ynh_print_info "Flarum does not need updating."
|
ynh_print_info "Flarum does not need updating."
|
||||||
|
upgraded_flarum=false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if upgrade of SSOwat extension is needed
|
# Check if upgrade of SSOwat extension is needed
|
||||||
|
@ -134,8 +140,10 @@ if [[ $(dpkg --compare-versions $old_ssowat_ext_ver lt $ssowat_ext_ver && echo t
|
||||||
sql_command="INSERT IGNORE INTO \`settings\` (\`key\`, \`value\`) VALUES ('tituspijean-auth-ssowat.domain', '$ssowatdomain'), ('tituspijean-auth-ssowat.onlyUse', '0');"
|
sql_command="INSERT IGNORE INTO \`settings\` (\`key\`, \`value\`) VALUES ('tituspijean-auth-ssowat.domain', '$ssowatdomain'), ('tituspijean-auth-ssowat.onlyUse', '0');"
|
||||||
ynh_mysql_execute_as_root "$sql_command" $db_name
|
ynh_mysql_execute_as_root "$sql_command" $db_name
|
||||||
ynh_print_info "SSOwat extension has been updated and configured."
|
ynh_print_info "SSOwat extension has been updated and configured."
|
||||||
|
upgraded_ssowat=true
|
||||||
else
|
else
|
||||||
ynh_print_info "SSOwat extension does not need updating."
|
ynh_print_info "SSOwat extension does not need updating."
|
||||||
|
upgraded_ssowat=false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $bazaar_extension -eq 1 ]; then
|
if [ $bazaar_extension -eq 1 ]; then
|
||||||
|
@ -218,5 +226,9 @@ systemctl reload nginx
|
||||||
# STORE SETTINGS
|
# STORE SETTINGS
|
||||||
#===================================================
|
#===================================================
|
||||||
|
|
||||||
ynh_app_setting_set $app flarum_version $flarum_version
|
if [ $upgraded_flarum ]; then
|
||||||
ynh_app_setting_set $app ssowat_ext_ver $ssowat_ext_ver
|
ynh_app_setting_set $app flarum_version $flarum_version
|
||||||
|
fi
|
||||||
|
if [ $upgraded_ssowat ]; then
|
||||||
|
ynh_app_setting_set $app ssowat_ext_ver $ssowat_ext_ver
|
||||||
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue