mirror of
https://github.com/YunoHost-Apps/garradin_ynh.git
synced 2024-09-03 18:36:17 +02:00
delete folder hooks and update the scripts install and upgrade
This commit is contained in:
parent
89e4cb44eb
commit
5eacdcef90
5 changed files with 22 additions and 91 deletions
|
@ -1,27 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC START
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
#Retrieve arguments
|
||||
#=================================================
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
final_path=/var/www/$app
|
||||
|
||||
#=================================================
|
||||
# Change options in file config.dist.php
|
||||
# and copy in local.dist.php
|
||||
#=================================================
|
||||
|
||||
sudo cp -a $final_path/config.dist.php $final_path/config.local.php
|
||||
|
||||
# ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$final_path/config.local.php"
|
||||
ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$final_path/config.local.php"
|
||||
ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '/garradin/';" --target_file="$final_path/config.local.php"
|
|
@ -1,27 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC START
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
#Retrieve arguments
|
||||
#=================================================
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
final_path=/var/www/$app
|
||||
|
||||
#=================================================
|
||||
# Change options in file config.dist.php
|
||||
# and copy in local.dist.php
|
||||
#=================================================
|
||||
|
||||
sudo cp -a $final_path/config.dist.php $final_path/config.local.php
|
||||
|
||||
# ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$final_path/config.local.php"
|
||||
ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$final_path/config.local.php"
|
||||
ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '/garradin/';" --target_file="$final_path/config.local.php"
|
|
@ -1,36 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC START
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
#Retrieve arguments
|
||||
#=================================================
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
final_path=/var/www/$app
|
||||
|
||||
#=================================================
|
||||
# Change options in file config.dist.php
|
||||
# and copy in config.local.php
|
||||
#=================================================
|
||||
|
||||
sudo cp -a $final_path/config.dist.php $final_path/config.local.php
|
||||
|
||||
#=================================================
|
||||
# backup the bdd
|
||||
#=================================================
|
||||
sudo cp -a /tmp/association.sqlite $final_path/association.sqlite
|
||||
sudo cp -avr /tmp/squelettes $final_path/www/squelettes
|
||||
|
||||
|
||||
# ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin;" --target_file="$final_path/config.local.php"
|
||||
ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$final_path/config.local.php"
|
||||
ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '/garradin/';" --target_file="$final_path/config.local.php"
|
||||
|
||||
|
|
@ -79,6 +79,17 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
|||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path"
|
||||
|
||||
#=================================================
|
||||
# Change options in file config.dist.php
|
||||
# and copy in local.dist.php
|
||||
#=================================================
|
||||
|
||||
sudo cp -a $final_path/config.dist.php $final_path/config.local.php
|
||||
|
||||
# ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$final_path/config.local.php"
|
||||
ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$final_path/config.local.php"
|
||||
ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '/garradin/';" --target_file="$final_path/config.local.php"
|
||||
|
||||
#=================================================
|
||||
# Files owned by user app
|
||||
#=================================================
|
||||
|
|
|
@ -50,10 +50,11 @@ elif [ "$is_public" = "No" ]; then
|
|||
fi
|
||||
|
||||
#=================================================
|
||||
# Backup squlite
|
||||
# Backup squlite, config.local.php and squelettes directory
|
||||
#=================================================
|
||||
sudo cp -avr $final_path/association.sqlite /tmp/association.sqlite
|
||||
sudo cp -avr $final_path/www/squelettes /tmp/squelettes
|
||||
sudo cp -a $final_path/config.local.php
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
|
@ -111,6 +112,15 @@ then
|
|||
ynh_setup_source --dest_dir="$final_path"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# backup bdd, squelettes directory and config.local.php
|
||||
#=================================================
|
||||
|
||||
sudo cp -a /tmp/config.local.php $final_path/config.local.php
|
||||
|
||||
sudo cp -a /tmp/association.sqlite $final_path/association.sqlite
|
||||
sudo cp -avr /tmp/squelettes $final_path/www/squelettes
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue