1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gitlab-runner_ynh.git synced 2024-09-03 19:15:58 +02:00
gitlab-runner_ynh/scripts/remove
2022-08-05 11:33:08 +02:00

68 lines
2.1 KiB
Bash
Executable file

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE SERVICE INTEGRATION IN YUNOHOST
#=================================================
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status $app >/dev/null
then
ynh_script_progression --message="Removing $app service integration..."
yunohost service remove $app
fi
#=================================================
# UNREGISTER ALL RUNNERS
#=================================================
ynh_script_progression --message="Unregistering all runners..."
ynh_exec_warn_less $app unregister --all-runners
#=================================================
# REMOVE GITLAB RUNNER
#=================================================
ynh_script_progression --message="Removing Gitlab Runner"
dpkg --remove $app
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..."
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
ynh_remove_extra_repo --name="${app}-docker"
#=================================================
# REMOVE VARIOUS FILES
#=================================================
ynh_script_progression --message="Removing various files..."
ynh_secure_remove --file="$config_path"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed" --last