1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gitlab_ynh.git synced 2024-09-03 18:36:35 +02:00
gitlab_ynh/scripts/remove

73 lines
2.3 KiB
Text
Raw Normal View History

2017-06-10 10:10:31 +02:00
#!/bin/bash
2018-12-19 00:02:20 +01:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2017-06-10 10:10:31 +02:00
2019-03-16 02:38:12 +01:00
source _common.sh
2017-06-10 10:10:31 +02:00
source /usr/share/yunohost/helpers
2018-12-19 00:02:20 +01:00
# STANDARD REMOVE
2019-03-24 21:36:20 +01:00
#=================================================
# REMOVE SERVICE FROM ADMIN PANEL
#=================================================
if yunohost service status "gitlab-runsvdir" >/dev/null 2>&1
then
2019-05-09 09:03:19 +02:00
ynh_script_progression --message="Removing $app service" --weight=1
2019-03-24 21:36:20 +01:00
yunohost service remove "gitlab-runsvdir"
fi
2018-12-19 00:02:20 +01:00
#=================================================
2019-03-16 02:38:12 +01:00
# STOP GITLAB
2018-12-19 00:02:20 +01:00
#=================================================
2020-12-23 17:08:21 +01:00
ynh_script_progression --message="Stopping GitLab" --weight=8
2019-01-26 14:30:58 +01:00
2019-05-13 00:25:03 +02:00
# I use gitlab-ctl and not ynh_systemd_action or systemctl to stop the service to avoid this error: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/common_installation_problems/README.md#reconfigure-freezes-at-ruby_blocksupervise_redis_sleep-action-run during the reinstall of the app
gitlab-ctl stop
2018-12-19 00:02:20 +01:00
#=================================================
2019-03-16 02:38:12 +01:00
# REMOVE GITLAB
2018-12-19 00:02:20 +01:00
#=================================================
2020-12-23 17:08:21 +01:00
ynh_script_progression --message="Removing GitLab" --weight=4
2018-12-19 00:02:20 +01:00
2019-03-16 02:38:12 +01:00
dpkg --remove gitlab-ce
2017-06-29 21:39:47 +02:00
2018-12-19 00:02:20 +01:00
#=================================================
# REMOVE APP MAIN DIR
#=================================================
2019-03-16 02:38:12 +01:00
# Remove the app directory securely
2023-03-03 11:24:16 +01:00
config_path=/etc/$app
2019-05-09 01:13:48 +02:00
ynh_secure_remove --file="$config_path"
2017-06-10 10:10:31 +02:00
2019-03-16 02:38:12 +01:00
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
2020-12-23 17:08:21 +01:00
ynh_script_progression --message="Removing NGINX web server configuration" --weight=1
2019-03-16 02:38:12 +01:00
2020-12-23 17:08:21 +01:00
# Remove the dedicated NGINX config
2019-03-16 02:38:12 +01:00
ynh_remove_nginx_config
2017-06-10 10:10:31 +02:00
2018-12-19 00:02:20 +01:00
#=================================================
2019-03-16 02:38:12 +01:00
# SPECIFIC REMOVE
#=================================================
# REMOVE GITLAB FILES
2018-12-19 00:02:20 +01:00
#=================================================
2019-05-09 01:13:48 +02:00
ynh_secure_remove --file="/var/opt/$app"
2019-03-16 02:38:12 +01:00
# Remove the log files
2019-05-09 01:13:48 +02:00
ynh_secure_remove --file="/var/log/$app"
2018-12-19 00:02:20 +01:00
2019-05-06 21:17:27 +02:00
# Remove swap
ynh_del_swap
2018-12-19 00:02:20 +01:00
#=================================================
2019-03-16 02:38:12 +01:00
# END OF SCRIPT
2018-12-19 00:02:20 +01:00
#=================================================
2020-12-23 17:18:58 +01:00
ynh_script_progression --message="Removal of GitLab completed" --last