1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/monica_ynh.git synced 2024-09-03 19:46:23 +02:00

Merge pull request #87 from Thovi98/upgrade

upgrade to 4.1.2
This commit is contained in:
eric_G 2024-06-17 21:51:12 +02:00 committed by GitHub
commit 4eef22735f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 14 additions and 44 deletions

View file

@ -4,7 +4,7 @@
# Two choices: local|production. Use local if you want to install Monica as a # Two choices: local|production. Use local if you want to install Monica as a
# development version. Use production otherwise. # development version. Use production otherwise.
APP_ENV=local APP_ENV=production
# true if you want to show debug information on errors. For production, put this # true if you want to show debug information on errors. For production, put this
# to false. # to false.

View file

@ -6,7 +6,7 @@
YNH_COMPOSER_VERSION="2.6.5" YNH_COMPOSER_VERSION="2.6.5"
NODEJS_VERSION=18 NODEJS_VERSION="20"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS

View file

@ -22,21 +22,13 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$install_dir" ynh_backup --src_path="$install_dir"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP THE PHP-FPM CONFIGURATION
#=================================================
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#=================================================
# BACKUP VARIOUS FILES
#=================================================
ynh_backup --src_path="/etc/cron.d/$app" ynh_backup --src_path="/etc/cron.d/$app"
#================================================= #=================================================

View file

@ -25,6 +25,7 @@ ynh_change_url_nginx_config
# Run monica update # Run monica update
pushd "$install_dir" pushd "$install_dir"
/usr/bin/php$phpversion artisan monica:update --force /usr/bin/php$phpversion artisan monica:update --force
/usr/bin/php$phpversion artisan optimize:clear
popd popd
#================================================= #=================================================

View file

@ -57,9 +57,9 @@ ynh_add_nginx_config
#================================================= #=================================================
# INSTALL COMPOSER DEPENDENCIES # INSTALL COMPOSER DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Installing Composer dependencies..." ynh_script_progression --message="Installing composer dependencies..."
ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --composerversion="$YNH_COMPOSER_VERSION" --workdir="$install_dir" ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$install_dir"
chmod 750 "$install_dir" chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
@ -85,11 +85,11 @@ ynh_replace_string --target_file="$install_dir/package.json" --match_string="php
#================================================= #=================================================
# DEPLOY # DEPLOY
#================================================= #=================================================
ynh_script_progression --message="Deploying $app..." ynh_script_progression --message="Deploying..."
pushd "$install_dir" pushd "$install_dir"
ynh_use_nodejs ynh_use_nodejs
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install --production ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn run production ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn run production
ynh_exec_warn_less ynh_exec_as $app php$phpversion artisan setup:production --force --email=$email --password=$password ynh_exec_warn_less ynh_exec_as $app php$phpversion artisan setup:production --force --email=$email --password=$password
ynh_exec_warn_less ynh_exec_as $app php$phpversion artisan passport:client --password -n > key.txt ynh_exec_warn_less ynh_exec_as $app php$phpversion artisan passport:client --password -n > key.txt
@ -101,6 +101,7 @@ pushd "$install_dir"
ynh_app_setting_set --app=$app --key=mobile_key --value=$mobile_key ynh_app_setting_set --app=$app --key=mobile_key --value=$mobile_key
ynh_secure_remove --file="$install_dir/key.txt" ynh_secure_remove --file="$install_dir/key.txt"
ynh_exec_warn_less ynh_exec_as $app php$phpversion artisan config:cache ynh_exec_warn_less ynh_exec_as $app php$phpversion artisan config:cache
ynh_exec_warn_less ynh_exec_as $app php$phpversion artisan optimize:clear
popd popd
# Calculate and store the config file checksum into the app settings # Calculate and store the config file checksum into the app settings
@ -109,13 +110,6 @@ ynh_store_file_checksum --file="$install_dir/.env"
chmod 400 "$install_dir/.env" chmod 400 "$install_dir/.env"
chown $app:$app "$install_dir/.env" chown $app:$app "$install_dir/.env"
#==================================================
# FIX PHP VERSION
#==================================================
ynh_script_progression --message="Fixing PHP version in package.json..." --weight=1
ynh_replace_string --target_file="$install_dir/package.json" --match_string="php artisan lang:generate -vvv" --replace_string="php$phpversion artisan lang:generate -vvv"
#================================================= #=================================================
# INSTALL THE CRON FILE # INSTALL THE CRON FILE
#================================================= #=================================================

View file

@ -38,7 +38,6 @@ ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
#================================================= #=================================================
ynh_script_progression --message="Updating $app's configuration files..." --weight=1 ynh_script_progression --message="Updating $app's configuration files..." --weight=1
# Create a dedicated PHP-FPM config
ynh_add_fpm_config ynh_add_fpm_config
# Create a dedicated NGINX config # Create a dedicated NGINX config
@ -108,26 +107,12 @@ pushd "$install_dir"
ynh_exec_warn_less ynh_exec_as $app php$phpversion artisan config:cache ynh_exec_warn_less ynh_exec_as $app php$phpversion artisan config:cache
popd popd
#if ynh_version_gt "2.15.0" "${previous_version}" ; then
# ynh_script_progression --message="Upgrading for 2.15.0..."
# pushd "$install_dir"
# ynh_exec_warn_less ynh_exec_as $app php$phpversion artisan monica:moveavatarstophotosdirectory
# popd
#fi
# Calculate and store the config file checksum into the app settings # Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$install_dir/.env" ynh_store_file_checksum --file="$install_dir/.env"
chmod 400 "$install_dir/.env" chmod 400 "$install_dir/.env"
chown $app:$app "$install_dir/.env" chown $app:$app "$install_dir/.env"
#==================================================
# FIX PHP VERSION
#==================================================
ynh_script_progression --message="Fixing PHP version in package.json..." --weight=1
ynh_replace_string --target_file="$install_dir/package.json" --match_string="php artisan lang:generate -vvv" --replace_string="php$phpversion artisan lang:generate -vvv"
#================================================= #=================================================
# INSTALL THE CRON FILE # INSTALL THE CRON FILE
#================================================= #=================================================

View file

@ -1,5 +1,3 @@
test_format = 1.0 test_format = 1.0
[default] [default]
test_upgrade_from.272460bc.name = "Upgrade from 3.7.0~ynh2"