1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pixelfed_ynh.git synced 2024-09-03 20:06:04 +02:00

Adding info during compatibility upgrades

This commit is contained in:
yalh76 2020-05-28 17:55:04 +02:00
parent c77d03d4af
commit 64c4e839bb

View file

@ -85,15 +85,18 @@ ynh_print_info --message="Ensuring upgrade compatibility..."
# If app_key doesn't exist, retrieve it # If app_key doesn't exist, retrieve it
if [ -z "$app_key" ]; then if [ -z "$app_key" ]; then
ynh_print_info --message="Retrieving app_key..."
app_key=$(grep -oP "APP_KEY=\Kbase64.*" "$final_path/.env") app_key=$(grep -oP "APP_KEY=\Kbase64.*" "$final_path/.env")
ynh_app_setting_set --app="$app" --key=app_key --value="$app_key" ynh_app_setting_set --app="$app" --key=app_key --value="$app_key"
fi fi
if dpkg --compare-versions "0.9.0~ynh3" gt "$(ynh_read_manifest --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" --manifest_key="version" || echo 1.0)" ; then if dpkg --compare-versions "0.9.0~ynh3" gt "$(ynh_read_manifest --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" --manifest_key="version" || echo 1.0)" ; then
ynh_print_info --message="Ensuring upgrade compatibility to 0.9.0~ynh3..."
ynh_add_systemd_config --service="${app}-horizon" --template=horizon.conf ynh_add_systemd_config --service="${app}-horizon" --template=horizon.conf
fi fi
if dpkg --compare-versions "0.10.9~ynh2" gt "$(ynh_read_manifest --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" --manifest_key="version" || echo 1.0)" ; then if dpkg --compare-versions "0.10.9~ynh2" gt "$(ynh_read_manifest --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" --manifest_key="version" || echo 1.0)" ; then
ynh_print_info --message="Ensuring upgrade compatibility to 0.10.9~ynh2..."
ynh_remove_systemd_config --service="${app}-horizon" ynh_remove_systemd_config --service="${app}-horizon"
ynh_install_app_dependencies "$pkg_dependencies" ynh_install_app_dependencies "$pkg_dependencies"
mkdir -p "/var/log/$app/" mkdir -p "/var/log/$app/"
@ -104,6 +107,7 @@ if dpkg --compare-versions "0.10.9~ynh2" gt "$(ynh_read_manifest --manifest="/et
fi fi
if dpkg --compare-versions "0.10.9~ynh3" gt "$(ynh_read_manifest --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" --manifest_key="version" || echo 1.0)" ; then if dpkg --compare-versions "0.10.9~ynh3" gt "$(ynh_read_manifest --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" --manifest_key="version" || echo 1.0)" ; then
ynh_print_info --message="Ensuring upgrade compatibility to 0.10.9~ynh3..."
yunohost service remove "${app}-horizon" yunohost service remove "${app}-horizon"
yunohost service add "supervisor" --description "Supervisor daemon for $app" --log "/var/log/$app/${app}-horizon.log" yunohost service add "supervisor" --description "Supervisor daemon for $app" --log "/var/log/$app/${app}-horizon.log"
fi fi