1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/funkwhale_ynh.git synced 2024-09-03 18:36:24 +02:00

Fix upgrade

This commit is contained in:
yalh76 2021-04-08 03:43:34 +02:00
parent 11451152d0
commit e496d312a5

View file

@ -108,21 +108,28 @@ if [ -z "$datadir" ]; then
ynh_store_file_checksum --file="$final_path/config/.env" ynh_store_file_checksum --file="$final_path/config/.env"
ynh_delete_file_checksum --file="$final_path/code/config/.env" ynh_delete_file_checksum --file="$final_path/code/config/.env"
rsync -a $final_path/code/data/static/ $datadir/static/ if [ -d "$final_path/code/data/static/" ]; then
rsync -a $final_path/media/ $datadir/media/ rsync -a $final_path/code/data/static/ $datadir/static/
rsync -a $final_path/import/ $datadir/music/ fi
if [ -d "$final_path/media/" ]; then
rsync -a $final_path/media/ $datadir/media/
fi
if [ -d "$final_path/import/" ]; then
rsync -a $final_path/import/ $datadir/music/
fi
ynh_secure_remove --file="$final_path/code" ynh_secure_remove --file="$final_path/code"
ynh_secure_remove --file="$final_path/media" ynh_secure_remove --file="$final_path/media"
ynh_secure_remove --file="$final_path/import" ynh_secure_remove --file="$final_path/import"
ynh_app_setting_set --app=$app --key=datadir --value=$datadir ynh_app_setting_set --app=$app --key=datadir --value=$datadir
upgrade_type="UPGRADE_APP"
fi fi
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Upgrading source files..."
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
@ -184,9 +191,9 @@ ynh_add_config --template="../conf/env.prod" --destination="$final_path/config/.
chmod 600 $final_path/config/.env chmod 600 $final_path/config/.env
#================================================= #=================================================
# MIGRATE FUNKWHALE # UPGRADE FUNKWHALE
#================================================= #=================================================
ynh_script_progression --message="Migrating Funkwhale..." ynh_script_progression --message="Upgrading Funkwhale..."
pushd $final_path pushd $final_path
source $final_path/virtualenv/bin/activate source $final_path/virtualenv/bin/activate
@ -237,7 +244,7 @@ ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.serv
ynh_script_progression --message="Securing files and directories..." ynh_script_progression --message="Securing files and directories..."
# Set permissions on app files # Set permissions on app files
chown -R $app: "$final_path" chown -R $app: $final_path
chown -R $app: $datadir chown -R $app: $datadir
#================================================= #=================================================