mirror of
https://github.com/YunoHost-Apps/peertube_remote_runner_ynh.git
synced 2024-09-03 19:56:21 +02:00
Unique runner ID (#4)
* Use ynh NPM * Use ynh NPM * improve runner_name * improve runner_name * peertube_url * peertube_url * peertube_url * test new npm command * fix syntax * fix syntax * change npm commands * fix npm command * fix parameters * fix parameters * use npm_node * use npm_node * fix typo * relative path * debugging * fix debug * improve debug * fix node_module * fix command syntax * fix syntax * debug * Fix binary path * Fix remove * Cleaning * Delete doc/screenshots directory * Auto-update README * cleaning + remove nginx * Delete nginx.conf * cleaning + remove nginx * Delete POST_UPGRADE.md * Delete PRE_UPGRADE.md * Delete PRE_INSTALL_fr.md * Delete PRE_INSTALL.md * Update POST_INSTALL.md * Update POST_INSTALL.md * Update DESCRIPTION.md * Auto-update README * Update DESCRIPTION_fr.md * Auto-update README * Delete ADMIN.md * better doc link * Create PRE_INSTALL.md * Create PRE_INSTALL_fr.md * Fix change_url * Add path + help messages * Improvements * change hostname to unique ID * change hostname to unique ID * cleaning * register the runner (again) * fix id Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org> * cleaning * cleaning --------- Co-authored-by: yunohost-bot <yunohost@yunohost.org> Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
This commit is contained in:
parent
dca24edb3b
commit
94c1e65c62
3 changed files with 15 additions and 2 deletions
|
@ -61,9 +61,13 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap
|
|||
#=================================================
|
||||
ynh_script_progression --message="Registering the runner on Peertube server..." --weight=1
|
||||
|
||||
runner_id=$(ynh_string_random --length=5 --filter='0-9')
|
||||
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\_$(hostname)
|
||||
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\_$(hostname)
|
||||
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
|
||||
|
|
|
@ -58,6 +58,15 @@ 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
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue