diff --git a/manifest.toml b/manifest.toml index 5715e10..76b6ab9 100644 --- a/manifest.toml +++ b/manifest.toml @@ -26,7 +26,6 @@ ram.runtime = "50M" [install] [install.domain] type = "domain" - full_domain = true [install.init_main_permission] type = "group" diff --git a/scripts/install b/scripts/install index 444a511..3aed925 100755 --- a/scripts/install +++ b/scripts/install @@ -16,6 +16,9 @@ ynh_script_progression --message="Installing dependencies..." --weight=5 ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +# Upgrade NPM +ynh_npm install --global npm@latest + # Install Yarn ynh_npm install --global yarn @@ -51,7 +54,7 @@ pushd $install_dir ynh_use_nodejs ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --weight=18 - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=100000 ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build diff --git a/scripts/upgrade b/scripts/upgrade index eb8cca9..8458172 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,6 +18,19 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=5 + +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version + +# Upgrade NPM +ynh_npm install --global npm@latest + +# Install Yarn +ynh_npm install --global yarn + #================================================= # "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) #================================================= @@ -25,9 +38,22 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_script_progression --message="Upgrading source files..." + # Move old app dir + mv ${install_dir} ${install_dir}.old + # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" +# restore data + cp -a ${install_dir}.old/config ${install_dir} + + # delete temp directory + ynh_secure_remove --file=${install_dir}.old +fi + chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -41,7 +67,7 @@ pushd $install_dir ynh_use_nodejs ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --weight=18 - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=100000 ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build