mirror of
https://github.com/YunoHost-Apps/mattermost_ynh.git
synced 2024-09-03 19:36:29 +02:00
upgrade: use app.src
This commit is contained in:
parent
bede450e88
commit
d2566887a8
1 changed files with 3 additions and 16 deletions
|
@ -27,8 +27,6 @@ root_path="$(pwd)/.."
|
||||||
final_path="/var/www/$app"
|
final_path="/var/www/$app"
|
||||||
data_path="/home/yunohost.app/$app"
|
data_path="/home/yunohost.app/$app"
|
||||||
logs_path="/var/log/$app"
|
logs_path="/var/log/$app"
|
||||||
version=$(cat "$root_path/VERSION")
|
|
||||||
archive_filename="mattermost-$version.tar.gz"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
|
@ -45,20 +43,11 @@ ynh_clean_setup () {
|
||||||
fi
|
fi
|
||||||
# Restore the backup
|
# Restore the backup
|
||||||
ynh_restore_upgradebackup
|
ynh_restore_upgradebackup
|
||||||
# Remove the temporary archive
|
|
||||||
sudo rm -f "$archive_filename"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
ynh_abort_if_errors
|
ynh_abort_if_errors
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# DOWNLOAD SOURCE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
archive_url="https://releases.mattermost.com/${version}/mattermost-team-${version}-linux-amd64.tar.gz"
|
|
||||||
sudo wget --quiet --output-document "$archive_filename" "$archive_url"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STOP SERVER
|
# STOP SERVER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -84,13 +73,11 @@ backup_config_file="/tmp/config.json"
|
||||||
sudo cp -f "$config_file" "$backup_config_file"
|
sudo cp -f "$config_file" "$backup_config_file"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# COPY NEW CODE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
sudo rm -rf "$final_path"
|
ynh_app_setting_set "$app" final_path "$final_path"
|
||||||
sudo mkdir -p "$final_path"
|
ynh_setup_source "$final_path"
|
||||||
sudo tar -xvz --file "$archive_filename" --directory "$final_path" --strip-components 1
|
|
||||||
sudo rm -f "$archive_filename"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE CONFIGURATION FILE
|
# RESTORE CONFIGURATION FILE
|
||||||
|
|
Loading…
Add table
Reference in a new issue