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:
commit
cd3aa7643b
2 changed files with 28 additions and 16 deletions
9
conf/config.ini.php
Normal file
9
conf/config.ini.php
Normal 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_"
|
||||
|
|
@ -81,26 +81,24 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|||
then
|
||||
ynh_script_progression --message="Upgrading source files..."
|
||||
|
||||
# Create a temporary directory
|
||||
tmpdir="$(mktemp -d)"
|
||||
# Backup the config file in the temp dir
|
||||
cp -a "$final_path/config/config.ini.php" "$tmpdir/config.ini.php"
|
||||
if [[ ! -f "$final_path/config/config.ini.php" ]]; then
|
||||
ynh_setup_source --dest_dir="$final_path"
|
||||
else
|
||||
# Create a temporary directory
|
||||
tmpdir="$(mktemp -d)"
|
||||
|
||||
# Remove the app directory securely
|
||||
ynh_secure_remove --file="$final_path"
|
||||
# Backup the config file in the temp dir
|
||||
cp -a "$final_path/config/config.ini.php" "$tmpdir/config.ini.php"
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path"
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$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"
|
||||
# Copy the admin saved settings from tmp directory to final path
|
||||
cp -a "$tmpdir/config.ini.php" "$final_path/config/config.ini.php"
|
||||
|
||||
# Remove the tmp directory securely
|
||||
ynh_secure_remove --file="$tmpdir"
|
||||
|
||||
pushd "$final_path"
|
||||
ynh_exec_as $app ./console core:update
|
||||
popd
|
||||
# Remove the tmp directory securely
|
||||
ynh_secure_remove --file="$tmpdir"
|
||||
fi
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
@ -136,6 +134,11 @@ ynh_script_progression --message="Installating composer and dependencies..."
|
|||
|
||||
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
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue