From c04fcb0a4ae2533a02eda8c69bb70add57e8cd4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 9 Jun 2024 10:22:59 +0200 Subject: [PATCH] cleaning --- scripts/backup | 14 -------------- scripts/remove | 5 ----- scripts/upgrade | 35 +++++++++++++---------------------- 3 files changed, 13 insertions(+), 41 deletions(-) diff --git a/scripts/backup b/scripts/backup index 7f7edc0..e4d50d3 100644 --- a/scripts/backup +++ b/scripts/backup @@ -26,24 +26,10 @@ ynh_backup --src_path="$install_dir" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP LOGROTATE -#================================================= - ynh_backup --src_path="/etc/logrotate.d/$app" -#================================================= -# BACKUP SYSTEMD -#================================================= - ynh_backup --src_path="/etc/systemd/system/$app.service" -#================================================= -# BACKUP VARIOUS FILES -#================================================= - ynh_backup --src_path="/etc/cron.d/$app" #================================================= diff --git a/scripts/remove b/scripts/remove index ca7f10d..3406a71 100644 --- a/scripts/remove +++ b/scripts/remove @@ -22,11 +22,6 @@ then yunohost service remove "$app" fi -#================================================= -# REMOVE SYSTEM CONFIGURATIONS -#================================================= -ynh_script_progression --message="Removing system configurations related to $app..." --weight=10 - dpkg --remove crystal # Remove the dedicated systemd config diff --git a/scripts/upgrade b/scripts/upgrade index f8bb121..f4d92c0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,12 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -69,24 +63,21 @@ ynh_exec_warn_less curl -fsSL https://crystal-lang.org/install.sh | bash -s -- - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --weight=5 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=5 +pushd "$install_dir" + chown -R "$app:www-data" "$install_dir" + git config --system --add safe.directory "$install_dir" + ynh_exec_as "$app" git config pull.rebase false + + ynh_exec_as "$app" git fetch + #git checkout master + ynh_exec_as "$app" git reset --hard --quiet "$version_commit" + ynh_exec_as "$app" git pull + ynh_exec_warn_less shards install --production + ynh_exec_warn_less crystal build "$install_dir/src/invidious.cr" --release +popd - pushd "$install_dir" - chown -R "$app:www-data" "$install_dir" - git config --system --add safe.directory "$install_dir" - ynh_exec_as "$app" git config pull.rebase false - - ynh_exec_as "$app" git fetch - #git checkout master - ynh_exec_as "$app" git reset --hard --quiet "$version_commit" - ynh_exec_as "$app" git pull - ynh_exec_warn_less shards install --production - ynh_exec_warn_less crystal build "$install_dir/src/invidious.cr" --release - popd -fi chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir"