1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/etherpad_ynh.git synced 2024-09-03 18:36:10 +02:00

Update upgrade

This commit is contained in:
ericgaspar 2021-03-05 14:20:02 +01:00
parent 9a19bf2ef9
commit b9cd3d4fde
No known key found for this signature in database
GPG key ID: 574F281483054D44

View file

@ -84,22 +84,6 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=42
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
pushd "$final_path"
git pull origin
ynh_use_nodejs
ynh_exec_as $app env "$ynh_node_load_PATH" src/bin/run.sh
popd
fi
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -126,15 +110,31 @@ ynh_script_progression --message="Making sure dedicated system user exists..." -
ynh_system_user_create --username=$app ynh_system_user_create --username=$app
#================================================= #=================================================
# MODIFY A CONFIG FILE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Reconfiguring Etherpad..." --weight=6
ynh_add_config --template="../conf/settings.json" --destination="$final_path/settings.json" if [ "$upgrade_type" == "UPGRADE_APP" ]
ynh_store_file_checksum --file="$final_path/settings.json" then
ynh_script_progression --message="Upgrading source files..." --weight=1
ynh_add_config --template="../conf/credentials.json" --destination="$final_path/credentials.json" # Download, check integrity, uncompress and patch the source from app.src
ynh_store_file_checksum --file="$final_path/credentials.json" pushd "$final_path"
git pull origin
ynh_use_nodejs
ynh_exec_as $app env "$ynh_node_load_PATH" src/bin/run.sh
popd
fi
# #=================================================
# # MODIFY A CONFIG FILE
# #=================================================
# ynh_script_progression --message="Reconfiguring Etherpad..." --weight=6
# ynh_add_config --template="../conf/settings.json" --destination="$final_path/settings.json"
# ynh_store_file_checksum --file="$final_path/settings.json"
# ynh_add_config --template="../conf/credentials.json" --destination="$final_path/credentials.json"
# ynh_store_file_checksum --file="$final_path/credentials.json"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION