From d0132e2e63c957148bb992a9081450570da6a654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 9 Nov 2023 12:29:45 +0100 Subject: [PATCH] Cleaning --- manifest.toml | 4 ++-- scripts/backup | 6 ------ scripts/install | 54 +------------------------------------------------ scripts/remove | 3 --- scripts/restore | 2 -- scripts/upgrade | 14 ------------- 6 files changed, 3 insertions(+), 80 deletions(-) diff --git a/manifest.toml b/manifest.toml index 85b0d32..9063261 100644 --- a/manifest.toml +++ b/manifest.toml @@ -4,8 +4,8 @@ packaging_format = 2 id = "forgejo-runner" name = "Forgejo Runner" -description.en = "Runner for Forgejo based" -description.fr = "Runner pour Forgejo basé" +description.en = "Runner for Forgejo" +description.fr = "Runner pour Forgejo" version = "3.0.3~ynh1" diff --git a/scripts/backup b/scripts/backup index e8e2890..ac5b947 100755 --- a/scripts/backup +++ b/scripts/backup @@ -21,12 +21,6 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$install_dir" -#================================================= -# BACKUP THE NGINX CONFIGURATION -#================================================= - -#ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # BACKUP SYSTEMD #================================================= diff --git a/scripts/install b/scripts/install index a9e123c..04ef7cd 100755 --- a/scripts/install +++ b/scripts/install @@ -13,29 +13,6 @@ forgejo_url=$YNH_APP_ARG_FORGEJO_URL token=$YNH_APP_ARG_TOKEN docker_image="alpine:latest" -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -ynh_script_progression --message="Validating installation parameters..." - -# By default, the runner will use docker to run your builds. PR are welcomes to implement more executors -#executor="docker" - -# Adding a comma at the end -#if [ ${forgejo_url: -1} != "," ]; then - forgejo_url=${forgejo_url}, -#fi - -# Adding a comma at the end -#if [ ${token: -1} != "," ]; then - token=${token}, -#fi - -# Adding a comma at the end -#if [ ${docker_image: -1} != "," ]; then - docker_image=${docker_image}, -#fi - #================================================= # APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC) #================================================= @@ -59,35 +36,6 @@ ynh_add_systemd_config yunohost service add $app --description="Runner for Forgejo" --log="/var/log/$app/$app.log" -#================================================= -# SETUP GITLAB RUNNER -#================================================= -#ynh_script_progression --message="Configuring Forgejo Runner..." - -# Can be registered several time, to do this give a list of forgejo_url, token and docker_image separated by a comma. -#split_char="," - -#nb_to_register=$(echo "${forgejo_url}" | awk -F"${split_char}" '{print NF-1}') - -#for i in $(seq $nb_to_register) -#do -# url=$(echo $forgejo_url | cut -d$split_char -f$i) -# tok=$(echo $token | cut -d$split_char -f$i) -# docker_img=$(echo $docker_image | cut -d$split_char -f$i) -# -# # Register the runner -# ynh_exec_warn_less $app register \ -# --non-interactive \ -# --url "$url" \ -# --registration-token "$tok" \ -# --executor "$executor" \ -# --docker-image "$docker_img" \ -# --description "YunoHost runner" \ -# --tag-list "$executor,$YNH_ARCH" \ -# --run-untagged \ -# --locked="false" -#done - #================================================= # APP INITIAL CONFIGURATION #================================================= @@ -96,7 +44,7 @@ yunohost service add $app --description="Runner for Forgejo" --log="/var/log/$ap ynh_script_progression --message="Adding a configuration file..." --weight=1 pushd $install_dir - ./forgejo-runner register --no-interactive --token $token --name runner #--instance $forgejo_url + ./forgejo-runner register --no-interactive --token $token --name runner --instance $forgejo_url popd #================================================= diff --git a/scripts/remove b/scripts/remove index 6dc3f14..13d70c0 100755 --- a/scripts/remove +++ b/scripts/remove @@ -25,9 +25,6 @@ fi ynh_remove_systemd_config -#ynh_remove_nginx_config - - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 5426cf5..886b737 100755 --- a/scripts/restore +++ b/scripts/restore @@ -27,8 +27,6 @@ chmod +x "$install_dir/forgejo-runner" #================================================= ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 -#ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet diff --git a/scripts/upgrade b/scripts/upgrade index ac0b0cb..1c424bb 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -40,24 +40,10 @@ chmod +x "$install_dir/forgejo-runner" #================================================= ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 -ynh_add_nginx_config - ynh_add_systemd_config yunohost service add $app --description="Runner for Forgejo" --log="/var/log/$app/$app.log" -#================================================= -# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...) -#================================================= -# UPDATE A CONFIG FILE -#================================================= -#ynh_script_progression --message="Updating a configuration file..." --weight=1 - -#ynh_add_config --template="some_config_file" --destination="$install_dir/some_config_file" - -#chmod 400 "$install_dir/some_config_file" -#chown $app:$app "$install_dir/some_config_file" - #================================================= # START SYSTEMD SERVICE #=================================================