mirror of
https://github.com/YunoHost-Apps/peertube_remote_runner_ynh.git
synced 2024-09-03 19:56:21 +02:00
cleaning
This commit is contained in:
parent
5b14a93fdb
commit
a0701755c5
5 changed files with 21 additions and 21 deletions
|
@ -4,11 +4,11 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=__APP__
|
||||
Group=__APP__
|
||||
Environment=NODE_ENV=production
|
||||
Environment=NODE_CONFIG_DIR=__INSTALL_DIR__/config
|
||||
Environment="__YNH_NODE_LOAD_PATH__"
|
||||
User=__APP__
|
||||
Group=__APP__
|
||||
ExecStart=__YNH_NODE__ __INSTALL_DIR__/node_modules/@peertube/peertube-runner server
|
||||
WorkingDirectory=__INSTALL_DIR__/
|
||||
StandardOutput=syslog
|
||||
|
|
|
@ -16,12 +16,12 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
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"
|
||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC MODIFICATIONS
|
||||
#=================================================
|
||||
# CHANGE REMOTE RUNNER URL INSIDE PEERTUBE
|
||||
# CHANGE REMOTE RUNNER URL INSIDE PEERTUBE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing the runner from Peertube, registering it with the new URL and name..." --weight=1
|
||||
|
||||
|
@ -38,7 +38,7 @@ popd
|
|||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
|
|
|
@ -27,7 +27,7 @@ chown -R $app:www-data "$install_dir"
|
|||
|
||||
pushd "$install_dir"
|
||||
ynh_use_nodejs
|
||||
ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm install @peertube/peertube-runner
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm install @peertube/peertube-runner
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
|
@ -48,12 +48,12 @@ yunohost service add $app --description="Peertube remote runner" --log="/var/log
|
|||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||
|
||||
# Start a systemd service
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC FINALIZATION
|
||||
#=================================================
|
||||
# RUNNER REGISTRATION
|
||||
# RUNNER REGISTRATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Registering the runner on Peertube server..." --weight=1
|
||||
|
||||
|
@ -62,7 +62,7 @@ ynh_app_setting_set --app=$app --key='runner_id' --value=$runner_id
|
|||
|
||||
pushd "$install_dir"
|
||||
ynh_use_nodejs
|
||||
ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_node "$install_dir/node_modules/@peertube/peertube-runner" register --url $peertube_url --registration-token $runner_token --runner-name $app\_$runner_id
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_node "$install_dir/node_modules/@peertube/peertube-runner" register --url $peertube_url --registration-token $runner_token --runner-name $app\_$runner_id
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
ynh_script_progression --message="Unregistering the runner on Peertube server..." --weight=1
|
||||
|
||||
ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_node "$install_dir/node_modules/@peertube/peertube-runner" unregister --url $peertube_url --registration-token $runner_token --runner-name $app\_$runner_id
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_node "$install_dir/node_modules/@peertube/peertube-runner" unregister --url $peertube_url --registration-token $runner_token --runner-name $app\_$runner_id
|
||||
|
||||
#=================================================
|
||||
# REMOVE SYSTEM CONFIGURATIONS
|
||||
|
@ -38,7 +38,7 @@ ynh_script_progression --message="Removing Peertube remote runner npm module..."
|
|||
|
||||
pushd "$install_dir"
|
||||
ynh_use_nodejs
|
||||
ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm uninstall @peertube/peertube-runner
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm uninstall @peertube/peertube-runner
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -33,7 +33,7 @@ ynh_script_progression --message="Installing Peertube remote runner npm module..
|
|||
|
||||
pushd "$install_dir"
|
||||
ynh_use_nodejs
|
||||
ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm install @peertube/peertube-runner
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm install @peertube/peertube-runner
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
|
@ -46,15 +46,6 @@ systemctl enable $app.service --quiet
|
|||
|
||||
yunohost service add $app --description="Peertube remote runner" --log="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# RUNNER REGISTRATION
|
||||
#=================================================
|
||||
|
||||
pushd "$install_dir"
|
||||
ynh_use_nodejs
|
||||
ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_node "$install_dir/node_modules/@peertube/peertube-runner" register --url $peertube_url --registration-token $runner_token --runner-name $app\_$runner_id
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
@ -67,6 +58,15 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap
|
|||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
#=================================================
|
||||
# RUNNER REGISTRATION
|
||||
#=================================================
|
||||
|
||||
pushd "$install_dir"
|
||||
ynh_use_nodejs
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_node "$install_dir/node_modules/@peertube/peertube-runner" register --url $peertube_url --registration-token $runner_token --runner-name $app\_$runner_id
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue