1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/flarum_ynh.git synced 2024-09-03 18:36:24 +02:00

Upgrade to v1.1.1

This commit is contained in:
tituspijean 2021-11-11 23:14:58 +01:00
parent b6a29ea2bb
commit 8ca8a86713
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720
4 changed files with 14 additions and 6 deletions

View file

@ -7,7 +7,7 @@
"fr": "Forum de nouvelle génération, simplement", "fr": "Forum de nouvelle génération, simplement",
"de": "Forum der nächsten Generation leicht gemacht" "de": "Forum der nächsten Generation leicht gemacht"
}, },
"version": "1.0.0~ynh6", "version": "1.1.1~ynh1",
"url": "http://flarum.org/", "url": "http://flarum.org/",
"upstream": { "upstream": {
"license": "MIT", "license": "MIT",

View file

@ -14,8 +14,8 @@ extra_php_dependencies="php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-dom php
# Version numbers # Version numbers
project_version="~1.0.0" project_version="~1.0.0"
core_version="~1.0.0" #core_version is now retrieved from the manifest
ldap_version="~1.0.0-p1" ldap_version="*"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS

View file

@ -31,6 +31,7 @@ admin_pwd=$YNH_APP_ARG_PASSWORD
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
language=$YNH_APP_ARG_LANGUAGE language=$YNH_APP_ARG_LANGUAGE
title=$YNH_APP_ARG_TITLE title=$YNH_APP_ARG_TITLE
core_version=$(ynh_app_upstream_version)
admin_mail=$(ynh_user_get_info --username=$admin --key=mail) admin_mail=$(ynh_user_get_info --username=$admin --key=mail)

View file

@ -26,6 +26,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
old_project_version=$(ynh_app_setting_get --app=$app --key=project_version) old_project_version=$(ynh_app_setting_get --app=$app --key=project_version)
old_core_version=$(ynh_app_setting_get --app=$app --key=core_version) old_core_version=$(ynh_app_setting_get --app=$app --key=core_version)
core_version=$(ynh_app_upstream_version)
old_ldap_version=$(ynh_app_setting_get --app=$app --key=ldap_version) old_ldap_version=$(ynh_app_setting_get --app=$app --key=ldap_version)
#================================================= #=================================================
@ -84,7 +85,7 @@ if [ ! -z "$bazaar_extension" ]; then
ynh_app_setting_delete --app=$app --key=bazaar_extension ynh_app_setting_delete --app=$app --key=bazaar_extension
fi fi
# Remove SSOwat if it exists # Remove SSOwat extension if it exists
ssowat_extension=$(ynh_app_setting_get --app=$app --key=ssowat_extension) ssowat_extension=$(ynh_app_setting_get --app=$app --key=ssowat_extension)
if [ ! -z "$ssowat_extension" ]; then if [ ! -z "$ssowat_extension" ]; then
ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$final_path --commands="remove tituspijean/flarum-ext-auth-ssowat" ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$final_path --commands="remove tituspijean/flarum-ext-auth-ssowat"
@ -183,6 +184,12 @@ then
# Install Composer and Flarum # Install Composer and Flarum
ynh_exec_warn_less ynh_install_composer --phpversion=$phpversion --workdir=$final_path ynh_exec_warn_less ynh_install_composer --phpversion=$phpversion --workdir=$final_path
if [ ynh_compare_current_package_version --comparison lt --version 1.1.0~ynh1 ]; then
# Starting 1.0 (implemented for 1.1 in the package), version requirement is "*" for extensions
# ... except for flarum/core, but that's handled in the next block.
jq '.require | .[] = "*"' $final_path/composer.json
fi
# Perform migrations and clear cache # Perform migrations and clear cache
pushd $final_path pushd $final_path
ynh_script_progression --message="Upgrading Flarum and its extensions..." --weight=1 ynh_script_progression --message="Upgrading Flarum and its extensions..." --weight=1
@ -210,14 +217,14 @@ fi
case $language in case $language in
fr) fr)
ynh_script_progression --message="Installing French extension..." --weight=2 ynh_script_progression --message="Installing French extension..." --weight=2
ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$final_path --commands="require qiaeru/lang-french:^2.0.0" ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$final_path --commands="require qiaeru/lang-french:*"
activate_flarum_extension $db_name "qiaeru-lang-french" activate_flarum_extension $db_name "qiaeru-lang-french"
sql_command="UPDATE \`settings\` SET \`value\` = 'fr' WHERE \`settings\`.\`key\` = 'default_locale'" sql_command="UPDATE \`settings\` SET \`value\` = 'fr' WHERE \`settings\`.\`key\` = 'default_locale'"
ynh_mysql_execute_as_root --sql="$sql_command" --database=$db_name ynh_mysql_execute_as_root --sql="$sql_command" --database=$db_name
;; ;;
de) de)
ynh_script_progression --message="Installing German extension..." --weight=2 ynh_script_progression --message="Installing German extension..." --weight=2
ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$final_path --commands="require kakifrucht/flarum-de:^1.0.0" ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$final_path --commands="require kakifrucht/flarum-de:*"
activate_flarum_extension $db_name "kakifrucht-de" activate_flarum_extension $db_name "kakifrucht-de"
sql_command="UPDATE \`settings\` SET \`value\` = 'de' WHERE \`settings\`.\`key\` = 'default_locale'" sql_command="UPDATE \`settings\` SET \`value\` = 'de' WHERE \`settings\`.\`key\` = 'default_locale'"
ynh_mysql_execute_as_root --sql="$sql_command" --database=$db_name ynh_mysql_execute_as_root --sql="$sql_command" --database=$db_name