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/backup

49 lines
1.4 KiB
Text
Raw Normal View History

2017-06-10 10:10:31 +02:00
#!/bin/bash
2018-12-24 16:25:49 +01:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2017-06-10 10:10:31 +02:00
# Source YunoHost helpers
source /usr/share/yunohost/helpers
2018-12-24 16:25:49 +01:00
# Load common variables and helpers
source ./_common.sh
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
2017-06-10 10:10:31 +02:00
2018-12-24 16:25:49 +01:00
ynh_clean_setup () {
### Remove this function if there's nothing to clean before calling the remove script.
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
2017-06-10 10:10:31 +02:00
# Copy NGINX configuration
domain=$(ynh_app_setting_get "$app" domain)
2018-12-24 16:25:49 +01:00
#=================================================
# STANDARD BACKUP STEPS
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
# Use gitlab-rake to backup
gitlab-rake gitlab:backup:create
ynh_backup "$config_path/gitlab-secrets.json" "gitlab-secrets.json"
ynh_backup "$config_path/gitlab.rb" "gitlab.rb"