2017-11-14 16:05:26 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
# Exit if an error occurs during the execution of the script
|
|
|
|
ynh_abort_if_errors
|
|
|
|
|
|
|
|
# Import common cmd
|
|
|
|
source ./_common.sh
|
2017-11-16 21:10:21 +01:00
|
|
|
source ./psql.sh
|
2017-11-14 16:05:26 +01:00
|
|
|
|
|
|
|
# LOAD SETTINGS
|
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
2017-11-16 21:10:21 +01:00
|
|
|
path_url=$(ynh_normalize_url_path $(ynh_app_setting_get $app path))
|
2017-11-14 16:05:26 +01:00
|
|
|
admin=$(ynh_app_setting_get $app admin)
|
|
|
|
|
|
|
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
|
|
|
ynh_backup_before_upgrade # Backup the current version of the app
|
|
|
|
ynh_clean_setup () {
|
|
|
|
ynh_restore_upgradebackup # restore it if the upgrade fails
|
|
|
|
}
|
|
|
|
|
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
2017-11-16 21:10:21 +01:00
|
|
|
install_source
|
2017-11-14 16:05:26 +01:00
|
|
|
|
2017-11-16 21:10:21 +01:00
|
|
|
# CONFIGURE PGADMIN
|
|
|
|
config_pgadmin
|
2017-11-14 16:05:26 +01:00
|
|
|
|
2017-11-16 21:10:21 +01:00
|
|
|
# Config uwsgi
|
|
|
|
config_uwsgi
|
2017-11-14 16:05:26 +01:00
|
|
|
|
2017-11-16 21:10:21 +01:00
|
|
|
# Set permission after initialisation
|
|
|
|
set_permission
|
2017-11-14 16:05:26 +01:00
|
|
|
|
2017-11-16 21:10:21 +01:00
|
|
|
# Create a dedicated nginx config
|
|
|
|
ynh_add_nginx_config
|
2017-11-14 16:05:26 +01:00
|
|
|
|
|
|
|
# RELOAD NGINX
|
2017-11-16 21:10:21 +01:00
|
|
|
systemctl reload uwsgi
|