1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/matomo_ynh.git synced 2024-09-03 19:45:56 +02:00

Merge branch 'upgrade-testing' into testing

This commit is contained in:
ericgaspar 2020-12-11 14:16:36 +01:00
commit cd3aa7643b
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 28 additions and 16 deletions

9
conf/config.ini.php Normal file
View file

@ -0,0 +1,9 @@
; <?php exit; ?> DO NOT REMOVE THIS LINE
; file automatically generated or modified by Matomo; you can manually override the default values in global.ini.php by redefining them in this file.
[database]
host = "127.0.0.1"
username = "__DB_NAME__"
password = "__DB_PASSWORD__"
dbname = "__DB_NAME__"
tables_prefix = "matomo_"

View file

@ -81,26 +81,24 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." ynh_script_progression --message="Upgrading source files..."
# Create a temporary directory if [[ ! -f "$final_path/config/config.ini.php" ]]; then
tmpdir="$(mktemp -d)" ynh_setup_source --dest_dir="$final_path"
# Backup the config file in the temp dir else
cp -a "$final_path/config/config.ini.php" "$tmpdir/config.ini.php" # Create a temporary directory
tmpdir="$(mktemp -d)"
# Remove the app directory securely # Backup the config file in the temp dir
ynh_secure_remove --file="$final_path" cp -a "$final_path/config/config.ini.php" "$tmpdir/config.ini.php"
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" ynh_setup_source --dest_dir="$final_path"
#Copy the admin saved settings from tmp directory to final path # Copy the admin saved settings from tmp directory to final path
cp -a "$tmpdir/config.ini.php" "$final_path/config/config.ini.php" cp -a "$tmpdir/config.ini.php" "$final_path/config/config.ini.php"
# Remove the tmp directory securely # Remove the tmp directory securely
ynh_secure_remove --file="$tmpdir" ynh_secure_remove --file="$tmpdir"
fi
pushd "$final_path"
ynh_exec_as $app ./console core:update
popd
fi fi
#================================================= #=================================================
@ -136,6 +134,11 @@ ynh_script_progression --message="Installating composer and dependencies..."
ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" ynh_install_composer --phpversion="$phpversion" --workdir="$final_path"
if [[ -f "$final_path/config/config.ini.php" ]]; then
cd "$final_path"
ynh_exec_as $app ./console core:update
fi
#================================================= #=================================================
# SETUP A CRON # SETUP A CRON
#================================================= #=================================================