From 5908f0ba0d7aac71438dd5c2ebc2efbe6a1ebe1d Mon Sep 17 00:00:00 2001 From: oufmilo <44617467+oufmilo@users.noreply.github.com> Date: Wed, 7 Feb 2024 22:34:34 +0100 Subject: [PATCH] Fix restore + upgrade --- scripts/restore | 14 ++++++++++++++ scripts/upgrade | 9 +++++---- tests.toml | 6 ++++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/scripts/restore b/scripts/restore index e65409e..5443a51 100755 --- a/scripts/restore +++ b/scripts/restore @@ -30,6 +30,20 @@ chown -R $app:www-data "$install_dir" # Define and install dependencies ynh_install_nodejs --nodejs_version=$NODEJS_VERSION +#================================================= +# REINSTALL PNPM +#================================================= +ynh_script_progression --message="Reinstalling PNPM..." --weight=1 + +# Define and install pnpm +pushd "$install_dir" + ynh_use_nodejs + corepack enable + corepack prepare pnpm@latest --activate + 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 +popd + #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2432a3b..4444cad 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -31,8 +31,11 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep=".config/default.yml" + pushd $install_dir + chown -R $app:www-data "$install_dir" + ynh_exec_warn_less ynh_exec_as $app git checkout stable + ynh_exec_warn_less ynh_exec_as $app git pull --recurse-submodules + popd fi chmod 750 "$install_dir" @@ -60,8 +63,6 @@ ynh_add_nginx_config ynh_script_progression --message="Building app..." pushd "$install_dir" - ynh_exec_warn_less git checkout stable - ynh_exec_warn_less git pull --recurse-submodules ynh_use_nodejs ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm cleanall ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm install --frozen-lockfile diff --git a/tests.toml b/tests.toml index 3fbad86..cb3409b 100644 --- a/tests.toml +++ b/tests.toml @@ -2,6 +2,12 @@ test_format = 1.0 [default] + # ------------------------------- + # Default args to use for install + # ------------------------------- + + exclude = ["change_url"] + # ------------------------------- # Commits to test upgrade from # ------------------------------- \ No newline at end of file