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

103 lines
2.8 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
#=================================================
2018-12-19 00:02:20 +01:00
# IMPORT GENERIC HELPERS
source /usr/share/yunohost/helpers
# Load common variables and helpers
source ./_common.sh
2017-06-10 10:10:31 +02:00
2018-12-19 00:02:20 +01:00
#=================================================
# LOAD SETTINGS
#=================================================
2017-06-10 10:10:31 +02:00
app=$YNH_APP_INSTANCE_NAME
# Retrieve app settings
domain=$(ynh_app_setting_get "$app" domain)
path_url=$(ynh_app_setting_get "$app" path_url)
admin=$(ynh_app_setting_get "$app" admin)
is_public=$(ynh_app_setting_get "$app" is_public)
port=$(ynh_app_setting_get "$app" web_port)
portUnicorn=$(ynh_app_setting_get "$app" unicorn_port)
2017-06-10 10:10:31 +02:00
2018-12-19 00:02:20 +01:00
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
# Backup the current version of the app
ynh_backup_before_upgrade
2019-01-26 14:46:52 +01:00
ynh_clean_setup() {
# restore it if the upgrade fails
ynh_restore_upgradebackup
}
2018-12-19 00:02:20 +01:00
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# CHECK THE PATH
#=================================================
# Normalize the URL path syntax
path_url=$(ynh_normalize_url_path $path_url)
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# NGINX CONFIGURATION
#=================================================
# Modify Nginx configuration file and copy it to Nginx conf directory
2018-12-19 00:34:06 +01:00
ynh_add_nginx_config
2017-06-10 10:10:31 +02:00
2018-12-19 00:02:20 +01:00
#=================================================
# CONFIGURE GITLAB
#=================================================
2017-06-10 10:10:31 +02:00
# Configure gitlab with gitlab.rb file
config_gitlab
2017-06-10 10:10:31 +02:00
2018-12-19 00:02:20 +01:00
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_install_app_dependencies openssh-server
2017-06-10 10:10:31 +02:00
2018-12-19 00:02:20 +01:00
#=================================================
# DOWNLOAD, CHECK AND INSTALL GITLAB
#=================================================
2017-06-10 10:10:31 +02:00
# Update Gitlab
setup_source $architecture
2018-04-14 18:38:22 +02:00
2018-12-19 00:02:20 +01:00
#=================================================
# GENERIC FINALIZATION
#=================================================
# SETUP SSOWAT
#=================================================
2017-06-10 10:10:31 +02:00
# If app is public, add url to SSOWat conf as skipped_uris
if [[ $is_public -eq 1 ]]; then
2019-01-26 14:46:52 +01:00
# See install script
ynh_app_setting_set "$app" unprotected_uris "/"
2017-06-10 10:10:31 +02:00
fi
2018-12-19 00:02:20 +01:00
#=================================================
# RELOAD NGINX
#=================================================
2017-06-10 10:10:31 +02:00
# Reload nginx service
2019-01-05 15:22:23 +01:00
systemctl reload nginx
2019-01-05 11:12:03 +01:00
#=================================================
# WAIT
#=================================================
2019-01-26 14:46:52 +01:00
waiting_to_start