1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/lychee_ynh.git synced 2024-09-03 19:36:36 +02:00
This commit is contained in:
ericgaspar 2020-12-27 18:50:10 +01:00
parent b5d1fbbba2
commit 018c8487f7
No known key found for this signature in database
GPG key ID: 574F281483054D44
5 changed files with 32 additions and 8 deletions

View file

@ -8,11 +8,14 @@ YNH_PHP_VERSION=7.4
extra_php_dependencies="php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-exif php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-mysqli php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-zip"
# needed for raw upload and video playback
pkg_dependencies="ufraw-batch ffmpeg"
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
readonly YNH_DEFAULT_COMPOSER_VERSION=1.10.17
readonly YNH_DEFAULT_COMPOSER_VERSION=2.0.8 #1.10.17
# Declare the actual composer version to use.
# A packager willing to use another version of composer can override the variable into its _common.sh.
YNH_COMPOSER_VERSION=${YNH_COMPOSER_VERSION:-$YNH_DEFAULT_COMPOSER_VERSION}

View file

@ -38,7 +38,7 @@ ynh_backup --src_path="$final_path"
# BACKUP MEDIA FOLDER
#=================================================
#ynh_backup --src_path="/home/yunohost.$app" --is_big
ynh_backup --src_path="/home/yunohost.$app" --is_big
#=================================================
# BACKUP THE NGINX CONFIGURATION

View file

@ -39,6 +39,14 @@ ynh_script_progression --message="Removing the MySQL database..." --weight=2
# Remove a database if it exists, along with the associated user
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=2
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================

View file

@ -54,6 +54,13 @@ ynh_script_progression --message="Restoring Lychee main directory..." --weight=2
ynh_restore_file --origin_path="$final_path"
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing dependencies..." --weight=3
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
@ -65,10 +72,10 @@ ynh_system_user_create --username=$app
#=================================================
# RESTORE DATA
#=================================================
#ynh_script_progression --message="Restoring Lychee data..."
ynh_script_progression --message="Restoring Lychee data..."
# Use --not_mandatory for the data directory, because if the backup has been made with BACKUP_CORE_ONLY, there's no data into the backup.
#ynh_restore_file --origin_path="/home/yunohost.$app" --not_mandatory
ynh_restore_file --origin_path="/home/yunohost.$app" --not_mandatory
#=================================================
# RESTORE USER RIGHTS
@ -76,7 +83,7 @@ ynh_system_user_create --username=$app
# Restore permissions on app files
chown -R $app: $final_path
#chmod -R 750 /home/yunohost.$app/{uploads,data}
chmod -R 750 /home/yunohost.$app
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION

View file

@ -95,6 +95,13 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing dependencies..." --weight=3
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# CREATE DEDICATED USER
#=================================================
@ -121,8 +128,7 @@ ynh_script_progression --message="Installing Composer..." --weight=10
# Install Composer
ynh_install_composer
ynh_exec_warn_less ynh_composer_exec --phpversion="$phpversion" --workdir="$final_path" --commands=\"dump-autoload\"
ynh_exec_warn_less ynh_composer_exec --phpversion="$phpversion" --workdir="$final_path" --commands="update --lock"
ynh_exec_warn_less ynh_composer_exec --commands=\"dump-autoload\"
pushd "$final_path"
php$phpversion artisan migrate -n --force
@ -140,7 +146,7 @@ ynh_store_file_checksum --file="$final_path/.env"
# Set permissions on app files
chown -R $app: $final_path
#chmod -R 750 /home/yunohost.$app/{uploads,data}
chmod -R 750 /home/yunohost.$app
#=================================================
# RELOAD NGINX