mirror of
https://github.com/YunoHost-Apps/lychee_ynh.git
synced 2024-09-03 19:36:36 +02:00
Fix
This commit is contained in:
parent
20f243c433
commit
6059249fbc
2 changed files with 32 additions and 20 deletions
|
@ -102,7 +102,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
ynh_script_progression --message="Installing Lychee with Composer..." --weight=15
|
ynh_script_progression --message="Installing Lychee with Composer..." --weight=15
|
||||||
|
|
||||||
# Install composer
|
# Install composer
|
||||||
ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" --install_args="--prefer-source --no-dev"
|
ynh_install_composer --workdir="$final_path" --install_args="--prefer-source --no-dev"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BUILDING
|
# BUILDING
|
||||||
|
|
|
@ -78,8 +78,39 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Upgrading source files..." --weight=4
|
ynh_script_progression --message="Upgrading source files..." --weight=4
|
||||||
|
|
||||||
|
|
||||||
|
# Create a temporary directory
|
||||||
|
tmpdir="$(mktemp -d)"
|
||||||
|
|
||||||
|
# Backup the config file in the temp dir
|
||||||
|
cp -a "$final_path/dist/user.css" "$tmpdir/user.css"
|
||||||
|
cp -a "$final_path/uploads" "$tmpdir/uploads"
|
||||||
|
|
||||||
|
# Remove the app directory securely
|
||||||
|
ynh_secure_remove --file="$final_path"
|
||||||
|
|
||||||
# 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
|
||||||
|
cp -a "$tmpdiruser.css" "$final_path/config/dist/user.css"
|
||||||
|
cp -a "$tmpdir/uploads" "$final_path/uploads"
|
||||||
|
|
||||||
|
# Remove the tmp directory securely
|
||||||
|
ynh_secure_remove --file="$tmpdir"
|
||||||
|
|
||||||
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
|
ynh_setup_source --dest_dir="$final_path"
|
||||||
|
|
||||||
|
ynh_install_composer --workdir="$final_path" --install_args="--prefer-source --no-dev"
|
||||||
|
|
||||||
|
pushd $final_path
|
||||||
|
php$phpversion artisan migrate -n --force
|
||||||
|
popd
|
||||||
|
|
||||||
|
ynh_backup_if_checksum_is_different --file="$final_path/.env"
|
||||||
|
# Recalculate and store the checksum of the file for the next upgrade.
|
||||||
|
ynh_store_file_checksum --file="$final_path/.env"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -106,25 +137,6 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..."
|
||||||
# Create a dedicated PHP-FPM config
|
# Create a dedicated PHP-FPM config
|
||||||
ynh_add_fpm_config --package="$extra_php_dependencies"
|
ynh_add_fpm_config --package="$extra_php_dependencies"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC UPGRADE
|
|
||||||
#=================================================
|
|
||||||
# INSTALL AND INITIALIZE COMPOSER
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Installing Composer..." --weight=10
|
|
||||||
|
|
||||||
# Install Composer
|
|
||||||
|
|
||||||
ynh_install_composer --phpversion="${YNH_PHP_VERSION}" --workdir="$final_path" --install_args="--prefer-source --no-dev"
|
|
||||||
|
|
||||||
pushd $final_path
|
|
||||||
php$phpversion artisan migrate #-n --force
|
|
||||||
popd
|
|
||||||
|
|
||||||
ynh_backup_if_checksum_is_different --file="$final_path/.env"
|
|
||||||
# Recalculate and store the checksum of the file for the next upgrade.
|
|
||||||
ynh_store_file_checksum --file="$final_path/.env"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SECURE FILES AND DIRECTORIES
|
# SECURE FILES AND DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue