From ae9c9af0e0d05a752e823161e4caea26f9b67a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 11 Sep 2023 10:07:13 +0200 Subject: [PATCH] cleaning --- manifest.toml | 4 ---- scripts/upgrade | 17 +++++++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/manifest.toml b/manifest.toml index 392ef14..044e4ad 100644 --- a/manifest.toml +++ b/manifest.toml @@ -53,9 +53,5 @@ ram.runtime = "50M" [resources.apt] packages ="ffmpeg, postgresql" - extras.yarn.repo = "deb https://dl.yarnpkg.com/debian/ stable main" - extras.yarn.key = "https://dl.yarnpkg.com/debian/pubkey.gpg" - extras.yarn.packages = "yarn" - [resources.database] type = "postgresql" diff --git a/scripts/upgrade b/scripts/upgrade index 8ae4455..dd81e4b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,6 +23,15 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 # Stop bservice before backup, to not loose message in case of failed upgrade and restore ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped" +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= + +if ynh_compare_current_package_version --comparison lt --version 12.109.2~ynh1 +then + ynh_die --message="Sorry, this version is not upgradable to the latest version :(" +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -60,10 +69,10 @@ ynh_script_progression --message="Building app..." pushd "$install_dir" ynh_use_nodejs - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn cleanall - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production yarn build - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn migrate + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm clean-all + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm install --frozen-lockfile + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production pnpm build + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm migrate popd #=================================================