From c5ad1563bdcb939780d58c5d2e975f3829eaae97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 6 Jul 2018 10:28:14 +0200 Subject: [PATCH] Move expect script in scripts directory --- .../expect_scripts}/first_launch.exp | 1 - {conf => scripts/expect_scripts}/install.exp | 0 .../expect_scripts}/minor-upgrade.exp | 0 .../expect_scripts}/upgrade_4.1.1.exp | 0 .../expect_scripts}/upgrade_4.2.1.exp | 0 .../expect_scripts}/upgrade_4.3.2.exp | 0 .../expect_scripts}/upgrade_4.4.3.exp | 0 .../expect_scripts}/upgrade_5.0.3.exp | 0 .../expect_scripts}/upgrade_5.1.exp | 0 .../expect_scripts}/upgrade_6.0.exp | 0 .../expect_scripts}/upgrade_6.1.exp | 0 .../expect_scripts}/upgrade_6.2.exp | 0 scripts/expect_scripts/upgrade_6.3.exp | 12 +++++++ scripts/install | 6 ++-- scripts/upgrade | 36 +++++++++---------- 15 files changed, 33 insertions(+), 22 deletions(-) rename {conf => scripts/expect_scripts}/first_launch.exp (90%) rename {conf => scripts/expect_scripts}/install.exp (100%) rename {conf => scripts/expect_scripts}/minor-upgrade.exp (100%) rename {conf => scripts/expect_scripts}/upgrade_4.1.1.exp (100%) rename {conf => scripts/expect_scripts}/upgrade_4.2.1.exp (100%) rename {conf => scripts/expect_scripts}/upgrade_4.3.2.exp (100%) rename {conf => scripts/expect_scripts}/upgrade_4.4.3.exp (100%) rename {conf => scripts/expect_scripts}/upgrade_5.0.3.exp (100%) rename {conf => scripts/expect_scripts}/upgrade_5.1.exp (100%) rename {conf => scripts/expect_scripts}/upgrade_6.0.exp (100%) rename {conf => scripts/expect_scripts}/upgrade_6.1.exp (100%) rename {conf => scripts/expect_scripts}/upgrade_6.2.exp (100%) create mode 100644 scripts/expect_scripts/upgrade_6.3.exp diff --git a/conf/first_launch.exp b/scripts/expect_scripts/first_launch.exp similarity index 90% rename from conf/first_launch.exp rename to scripts/expect_scripts/first_launch.exp index 5f71706..9d91326 100644 --- a/conf/first_launch.exp +++ b/scripts/expect_scripts/first_launch.exp @@ -3,7 +3,6 @@ set timeout 10 set seafile_dir [lindex $argv 0] set admin_email [lindex $argv 1] -set admin_password [lindex $argv 2] spawn $seafile_dir/seahub.sh start-fastcgi diff --git a/conf/install.exp b/scripts/expect_scripts/install.exp similarity index 100% rename from conf/install.exp rename to scripts/expect_scripts/install.exp diff --git a/conf/minor-upgrade.exp b/scripts/expect_scripts/minor-upgrade.exp similarity index 100% rename from conf/minor-upgrade.exp rename to scripts/expect_scripts/minor-upgrade.exp diff --git a/conf/upgrade_4.1.1.exp b/scripts/expect_scripts/upgrade_4.1.1.exp similarity index 100% rename from conf/upgrade_4.1.1.exp rename to scripts/expect_scripts/upgrade_4.1.1.exp diff --git a/conf/upgrade_4.2.1.exp b/scripts/expect_scripts/upgrade_4.2.1.exp similarity index 100% rename from conf/upgrade_4.2.1.exp rename to scripts/expect_scripts/upgrade_4.2.1.exp diff --git a/conf/upgrade_4.3.2.exp b/scripts/expect_scripts/upgrade_4.3.2.exp similarity index 100% rename from conf/upgrade_4.3.2.exp rename to scripts/expect_scripts/upgrade_4.3.2.exp diff --git a/conf/upgrade_4.4.3.exp b/scripts/expect_scripts/upgrade_4.4.3.exp similarity index 100% rename from conf/upgrade_4.4.3.exp rename to scripts/expect_scripts/upgrade_4.4.3.exp diff --git a/conf/upgrade_5.0.3.exp b/scripts/expect_scripts/upgrade_5.0.3.exp similarity index 100% rename from conf/upgrade_5.0.3.exp rename to scripts/expect_scripts/upgrade_5.0.3.exp diff --git a/conf/upgrade_5.1.exp b/scripts/expect_scripts/upgrade_5.1.exp similarity index 100% rename from conf/upgrade_5.1.exp rename to scripts/expect_scripts/upgrade_5.1.exp diff --git a/conf/upgrade_6.0.exp b/scripts/expect_scripts/upgrade_6.0.exp similarity index 100% rename from conf/upgrade_6.0.exp rename to scripts/expect_scripts/upgrade_6.0.exp diff --git a/conf/upgrade_6.1.exp b/scripts/expect_scripts/upgrade_6.1.exp similarity index 100% rename from conf/upgrade_6.1.exp rename to scripts/expect_scripts/upgrade_6.1.exp diff --git a/conf/upgrade_6.2.exp b/scripts/expect_scripts/upgrade_6.2.exp similarity index 100% rename from conf/upgrade_6.2.exp rename to scripts/expect_scripts/upgrade_6.2.exp diff --git a/scripts/expect_scripts/upgrade_6.3.exp b/scripts/expect_scripts/upgrade_6.3.exp new file mode 100644 index 0000000..da0b04b --- /dev/null +++ b/scripts/expect_scripts/upgrade_6.3.exp @@ -0,0 +1,12 @@ +#!/usr/bin/expect +set timeout 5 + +set seafile_dir [lindex $argv 0] +set mysql_password [lindex $argv 1] + +spawn $seafile_dir/upgrade/upgrade_6.2_6.3.sh + +expect "to contiune" +send "\r"; + +interact diff --git a/scripts/install b/scripts/install index 13a36e0..f6728de 100644 --- a/scripts/install +++ b/scripts/install @@ -88,9 +88,9 @@ ynh_mysql_create_db seahubdb "$dbuser" "$db_pwd" ynh_system_user_create $seafile_user $final_path # Run install script -chmod +x ../conf/install.exp +chmod +x expect_scripts/install.exp chmod +x $final_path/seafile-server-$seafile_version/setup-seafile-mysql.sh -../conf/install.exp "$final_path/seafile-server-$seafile_version" "$server_name" "$domain" "$seafile_data" "$fileserver_port" "$db_pwd" +expect_scripts/install.exp "$final_path/seafile-server-$seafile_version" "$server_name" "$domain" "$seafile_data" "$fileserver_port" "$db_pwd" # Update seafile config ynh_replace_string http:// https:// $final_path/conf/ccnet.conf @@ -142,7 +142,7 @@ update-rc.d seafile-server defaults config_nginx # Copy first launch script -cp ../conf/first_launch.exp $final_path +cp expect_scripts/first_launch.exp $final_path chmod +x $final_path/first_launch.exp # Set permissions to seafile directory diff --git a/scripts/upgrade b/scripts/upgrade index a140667..fe3f5e5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -46,8 +46,8 @@ test -e $final_path/seafile-server-$seafile_version && ynh_secure_remove "$final install_source # permission to execute update script and expect helper -chmod +x ../conf/upgrade_*.exp -chmod +x ../conf/minor-upgrade.exp +chmod +x expect_scripts/upgrade_*.exp +chmod +x expect_scripts/minor-upgrade.exp chmod +x $final_path/seafile-server-$seafile_version/upgrade/upgrade_*.sh chmod +x $final_path/seafile-server-$seafile_version/upgrade/minor-upgrade.sh @@ -55,52 +55,52 @@ chmod +x $final_path/seafile-server-$seafile_version/upgrade/minor-upgrade.sh case $installed_version in "4.0."* ) # Update seafile by script - ../conf/upgrade_4.1.1.exp $final_path/seafile-server-$seafile_version $root_pwd + expect_scripts/upgrade_4.1.1.exp $final_path/seafile-server-$seafile_version $root_pwd ;& "4.1."* ) # Update seafile by script - ../conf/upgrade_4.2.1.exp $final_path/seafile-server-$seafile_version $root_pwd + expect_scripts/upgrade_4.2.1.exp $final_path/seafile-server-$seafile_version $root_pwd ;& "4.3."* ) # Update seafile by script - ../conf/upgrade_4.4.3.exp $final_path/seafile-server-$seafile_version $root_pwd + expect_scripts/upgrade_4.4.3.exp $final_path/seafile-server-$seafile_version $root_pwd ;& "4.4."* ) # Update seafile by script - ../conf/upgrade_5.0.3.exp $final_path/seafile-server-$seafile_version $root_pwd + expect_scripts/upgrade_5.0.3.exp $final_path/seafile-server-$seafile_version $root_pwd ;& "5.0."* ) # Update seafile by script - ../conf/upgrade_5.1.exp $final_path/seafile-server-$seafile_version $root_pwd + expect_scripts/upgrade_5.1.exp $final_path/seafile-server-$seafile_version $root_pwd ;& "5.1."* ) # Update seafile by script - ../conf/upgrade_6.0.exp $final_path/seafile-server-$seafile_version $root_pwd + expect_scripts/upgrade_6.0.exp $final_path/seafile-server-$seafile_version $root_pwd ;& "6.0."* ) python3 ../conf/update_sso_conf.py || true install_dependance # Update seafile by script - ../conf/upgrade_6.1.exp $final_path/seafile-server-$seafile_version $root_pwd + expect_scripts/upgrade_6.1.exp $final_path/seafile-server-$seafile_version $root_pwd # Enable manually wiki echo 'ENABLE_WIKI = True' | tee -a $final_path/conf/seahub_settings.py ;& "6.1."* ) # Update seafile by script - ../conf/upgrade_6.2.exp $final_path/seafile-server-$seafile_version $root_pwd + expect_scripts/upgrade_6.2.exp $final_path/seafile-server-$seafile_version $root_pwd +;& +"6.2."* ) + # Update seafile by script + expect_scripts/upgrade_6.3.exp $final_path/seafile-server-$seafile_version $root_pwd + + # Update logrotate to have the last version + ynh_use_logrotate $final_path/logs --non-append ;& -# "6.2."* ) -# # Update seafile by script -# ../conf/upgrade_6.3.exp $final_path/seafile-server-$seafile_version $root_pwd -# -# # Update logrotate to have the last version -# ynh_use_logrotate $final_path/logs --non-append -# ;& esac -../conf/minor-upgrade.exp $final_path/seafile-server-$seafile_version $root_pwd +expect_scripts/minor-upgrade.exp $final_path/seafile-server-$seafile_version $root_pwd ## Install webdav and logrotate if not installed if [[ $installed_version = "4.0."* ]] || [[ $installed_version = "4.1."* ]]