mirror of
https://github.com/YunoHost-Apps/plume_ynh.git
synced 2024-09-03 20:15:54 +02:00
Fix upgrade
This commit is contained in:
parent
481bd9690e
commit
7580d8a425
4 changed files with 15 additions and 10 deletions
|
@ -38,7 +38,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Stopping a systemd service..."
|
ynh_print_info --message="Stopping a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="stop"
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped plume"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE APP MAIN DIR
|
# BACKUP THE APP MAIN DIR
|
||||||
|
@ -82,7 +82,7 @@ ynh_backup --src_path="/etc/systemd/system/$app.service"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Starting a systemd service..."
|
ynh_print_info --message="Starting a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started plume"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -58,7 +58,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Stopping a systemd service..."
|
ynh_print_info --message="Stopping a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="stop"
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped plume"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY URL IN NGINX CONF
|
# MODIFY URL IN NGINX CONF
|
||||||
|
@ -114,7 +114,7 @@ ynh_store_file_checksum --file="$final_path/$app/.env"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Starting a systemd service..."
|
ynh_print_info --message="Starting a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action=start
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started plume"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
|
|
|
@ -230,7 +230,7 @@ yunohost service add $app --description "$app daemon for XXX" --log "/var/log/$a
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Starting a systemd service..."
|
ynh_print_info --message="Starting a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started plume"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
|
|
|
@ -24,9 +24,6 @@ is_public=$(ynh_app_setting_get --app=$app --key=is_public)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
admin_email=$(ynh_app_setting_get --app=$app --key=admin_email)
|
|
||||||
secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
|
|
||||||
name=$(ynh_app_setting_get --app=$app --key=name)
|
|
||||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
|
|
||||||
architecture=$(ynh_detect_arch)
|
architecture=$(ynh_detect_arch)
|
||||||
|
@ -91,6 +88,7 @@ ynh_print_info --message="Backing up the app before upgrading (may take a while)
|
||||||
# Backup the current version of the app
|
# Backup the current version of the app
|
||||||
ynh_backup_before_upgrade
|
ynh_backup_before_upgrade
|
||||||
ynh_clean_setup () {
|
ynh_clean_setup () {
|
||||||
|
read -p "key"
|
||||||
# restore it if the upgrade fails
|
# restore it if the upgrade fails
|
||||||
ynh_restore_upgradebackup
|
ynh_restore_upgradebackup
|
||||||
ynh_clean_check_starting
|
ynh_clean_check_starting
|
||||||
|
@ -112,7 +110,7 @@ path_url=$(ynh_normalize_url_path --path_url=$path_url)
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Stopping a systemd service..."
|
ynh_print_info --message="Stopping a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action=stop
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped plume"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
|
@ -124,6 +122,13 @@ then
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source "$final_path/$app" $architecture
|
ynh_setup_source "$final_path/$app" $architecture
|
||||||
|
|
||||||
|
# Move binaries
|
||||||
|
mv $final_path/$app/bin/* $final_path/.cargo/bin/
|
||||||
|
chmod +x $final_path/.cargo/bin/*
|
||||||
|
|
||||||
|
# Remove empty bin directory
|
||||||
|
ynh_secure_remove --file="$final_path/$app/bin/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -225,7 +230,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Starting a systemd service..."
|
ynh_print_info --message="Starting a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action=start
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started plume"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
|
|
Loading…
Add table
Reference in a new issue