Add upgrade to 4.1.1

Former-commit-id: 59ac94fd59
This commit is contained in:
mbugeia 2015-03-25 19:14:18 +01:00
parent cf0d86b408
commit 8a0d80902d
5 changed files with 69 additions and 1 deletions

View file

@ -20,7 +20,11 @@ From command line:
Upgrade
-------
Not yet available
From command line:
`sudo yunohost app upgrade -l Seafile https://github.com/mbugeia/seafile_ynh seafile`
This will install Seafile v4.1.1 with HTTPS Sync only. /!\Not available on ARM for now /!\
Infos
-----

14
conf/upgrade_4.1.1.exp Normal file
View file

@ -0,0 +1,14 @@
#!/usr/bin/expect
set timeout 5
set mysql_password [lindex $argv 0]
spawn /var/www/seafile/seafile-server-4.1.1/upgrade/upgrade_4.0_4.1.sh
expect "to contiune"
send "\r";
expect "What is the root password for mysql?"
send "$mysql_password\r";
interact

48
scripts/upgrade Normal file
View file

@ -0,0 +1,48 @@
#!/bin/bash
app=seafile
# Retrieve settings
installed_version=$(sudo yunohost app setting $app installed_version)
architecture=$(sudo yunohost app setting $app architecture)
root_pwd=$(sudo cat /etc/yunohost/mysql)
seafile_version=4.1.1
final_path=/var/www/$app
# extract new version
sudo mkdir -p $final_path/seafile-server-$seafile_version
sudo tar xzf ../sources/'seafile-server_'$seafile_version'_'$architecture'.tar'
sudo mv seafile-server-$seafile_version/* $final_path/seafile-server-$seafile_version
sudo mv ../sources/'seafile-server_'$seafile_version'_'$architecture'.tar' $final_path/installed
# stop seafile server
sudo service seafile-server stop
# permission to execute update script and expect helper
sudo chmod +x ../conf/upgrade_4.1.1.exp
sudo chmod +x $final_path/seafile-server-$seafile_version/upgrade/upgrade_4.0_4.1.sh
# do the upgrade
sudo ../conf/upgrade_4.1.1.exp $root_pwd
# restore correct permissions
sudo chown -R www-data:www-data $final_path
# disallow port that was used by old seafile client
ccnet_port=$(sudo yunohost app setting $app ccnet_port)
seafile_port=$(sudo yunohost app setting $app seafile_port)
sudo yunohost firewall disallow $ccnet_port
sudo yunohost firewall disallow $seafile_port
# restart seafile server
sudo service seafile-server start
# remove old version files
sudo rm -f $final_path/installed/seafile-server_$installed_version_$architecture.tar
sudo rm -f $final_path/seafile-server_$installed_version_$architecture
# store new installed version
sudo yunohost app setting seafile installed_version -v $seafile_version
# Reload Nginx and regenerate SSOwat conf
sudo service nginx reload
sudo yunohost app ssowatconf

View file

@ -0,0 +1 @@
8af778d2df71d4b757dc748c98199a8df823a7da

View file

@ -0,0 +1 @@
db8a74bd09e625ba9664e150543a650d84597693