Cleaning
This commit is contained in:
parent
2f7c22664e
commit
d0132e2e63
6 changed files with 3 additions and 80 deletions
|
@ -4,8 +4,8 @@ packaging_format = 2
|
||||||
|
|
||||||
id = "forgejo-runner"
|
id = "forgejo-runner"
|
||||||
name = "Forgejo Runner"
|
name = "Forgejo Runner"
|
||||||
description.en = "Runner for Forgejo based"
|
description.en = "Runner for Forgejo"
|
||||||
description.fr = "Runner pour Forgejo basé"
|
description.fr = "Runner pour Forgejo"
|
||||||
|
|
||||||
version = "3.0.3~ynh1"
|
version = "3.0.3~ynh1"
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,6 @@ ynh_print_info --message="Declaring files to be backed up..."
|
||||||
|
|
||||||
ynh_backup --src_path="$install_dir"
|
ynh_backup --src_path="$install_dir"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP THE NGINX CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
#ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP SYSTEMD
|
# BACKUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -13,29 +13,6 @@ forgejo_url=$YNH_APP_ARG_FORGEJO_URL
|
||||||
token=$YNH_APP_ARG_TOKEN
|
token=$YNH_APP_ARG_TOKEN
|
||||||
docker_image="alpine:latest"
|
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)
|
# 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"
|
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
|
# 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
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||||
|
|
||||||
pushd $install_dir
|
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
|
popd
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -25,9 +25,6 @@ fi
|
||||||
|
|
||||||
ynh_remove_systemd_config
|
ynh_remove_systemd_config
|
||||||
|
|
||||||
#ynh_remove_nginx_config
|
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -27,8 +27,6 @@ chmod +x "$install_dir/forgejo-runner"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
|
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"
|
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||||
systemctl enable $app.service --quiet
|
systemctl enable $app.service --quiet
|
||||||
|
|
||||||
|
|
|
@ -40,24 +40,10 @@ chmod +x "$install_dir/forgejo-runner"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
|
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
|
||||||
|
|
||||||
ynh_add_nginx_config
|
|
||||||
|
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config
|
||||||
|
|
||||||
yunohost service add $app --description="Runner for Forgejo" --log="/var/log/$app/$app.log"
|
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
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue