1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/libreto_ynh.git synced 2024-09-03 19:36:14 +02:00

Update upgrade

This commit is contained in:
ericgaspar 2021-07-02 15:36:33 +02:00
parent 3ebef99436
commit db73da0285
No known key found for this signature in database
GPG key ID: 574F281483054D44

View file

@ -22,6 +22,12 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
etherpad_instance=$(ynh_app_setting_get --app=$app --key=etherpad_instance)
creation_open=$(ynh_app_setting_get --app=$app --key=creation_open)
#=================================================
# CHECK VERSION
#=================================================
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -35,20 +41,32 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Upgrading source files..." --weight=5
# Download, check integrity, uncompress and patch the source from app.src
pushd "$final_path"
git checkout master
git pull --quiet
git checkout $COMMIT --quiet
git submodule update --init --recursive --quiet
popd
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=5
# Download, check integrity, uncompress and patch the source from app.src
pushd "$final_path"
git checkout master
git pull --quiet
git checkout $COMMIT --quiet
git submodule update --init --recursive --quiet
popd
fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
@ -62,14 +80,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app
#=================================================
# PHP-FPM CONFIGURATION
#=================================================