1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jenkins_ynh.git synced 2024-09-03 19:26:18 +02:00
jenkins_ynh/scripts/upgrade
Maniack Crudelis 4f31b7624a Fix install & new helpers
Fix install with new deb package
Uses last helpers
Fix install with alternative port
2017-05-15 14:34:58 +02:00

67 lines
1.8 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
# Récupère les infos de l'application.
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
path_url=$(ynh_app_setting_get $app path)
is_public=$(ynh_app_setting_get $app is_public)
port=$(ynh_app_setting_get $app port)
#=================================================
# FIX OLD THINGS
#=================================================
if [ "$is_public" = "Yes" ]; then
ynh_app_setting_set $app is_public 1 # Fixe is_public en booléen
is_public=1
elif [ "$is_public" = "No" ]; then
ynh_app_setting_set $app is_public 0
is_public=0
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
BACKUP_BEFORE_UPGRADE # Backup the current version of the app
ynh_clean_setup () {
BACKUP_FAIL_UPGRADE # restore it if the upgrade fails
}
ynh_abort_if_errors # Active trap pour arrêter le script si une erreur est détectée.
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_nginx_config
#=================================================
# SETUP SSOWAT
#=================================================
if [ $is_public -eq 1 ]
then
ynh_app_setting_set $app unprotected_uris "/"
else
ynh_app_setting_delete $app unprotected_uris
fi
#=================================================
# RELOAD NGINX
#=================================================
sudo systemctl reload nginx