diff --git a/conf/systemd.service b/conf/systemd.service index 9aa5f06..f7e2158 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -10,7 +10,7 @@ Group=__APP__ WorkingDirectory=__FINALPATH__ Environment="PATH=__ENV_PATH__" Environment="NODE_ENV=production" -ExecStart=__YNH_NPM__ run +ExecStart=__YNH_NPM__ run build Restart=always PrivateTmp=true PrivateDevices=true diff --git a/scripts/install b/scripts/install index 756b1a4..75015f9 100644 --- a/scripts/install +++ b/scripts/install @@ -67,6 +67,14 @@ ynh_script_progression --message="Installing dependencies..." --weight=20 # Install Nodejs ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=3 + +# Create a system user +ynh_system_user_create --username=$app --home_dir=$final_path + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -84,14 +92,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=3 - -# Create a system user -ynh_system_user_create --username=$app --home_dir=$final_path - #================================================= # SPECIFIC SETUP #============================================== @@ -100,11 +100,9 @@ ynh_system_user_create --username=$app --home_dir=$final_path ynh_script_progression --message="Building Luckysheet... (this will take some time and resources!)" --weight=20 pushd "$final_path" || ynh_die - ynh_use_nodejs ynh_exec_warn_less ynh_npm install ynh_exec_warn_less ynh_npm install gulp -g - popd || ynh_die #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8dddeca..a418f1e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -63,6 +63,14 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action=stop --log_path=systemd +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 + +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir=$final_path + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -94,14 +102,6 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=18 # Install Nodejs ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app - #================================================= # SPECIFIC UPGRADE #==============================================