From 965fa94fc2cd3209542a8ed5ce36093b22ede44b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 15 Oct 2023 11:46:04 +0200 Subject: [PATCH] Update upgrade --- scripts/upgrade | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 4fa1295..a00a1b0 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -46,24 +46,6 @@ if [ -z "$email" ]; then ynh_app_setting_set --app=$app --key=email --value=$email fi -#================================================= -# DOWNLOAD, CHECK AND UNPACK SOURCE -#================================================= - -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=1 - - # Download, check integrity, uncompress and patch the source from app.src - pushd $install_dir - ynh_use_nodejs - ynh_exec_warn_less env $ynh_node_load_PATH npm install n8n@${n8n_version} - popd -fi - -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - #================================================= # NGINX CONFIGURATION #================================================= @@ -90,6 +72,17 @@ ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" chmod 400 "$install_dir/.env" chown $app:$app "$install_dir/.env" +#================================================= +# INSTALL n8n +#================================================= +ynh_script_progression --message="Installing $app..." --weight=2 + +# Download, check integrity, uncompress and patch the source from app.src +pushd $install_dir + ynh_use_nodejs + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm update n8n@${n8n_version} +popd + #================================================= # START SYSTEMD SERVICE #=================================================