From ef2ca80d36d53669cae256fe6d8c3ce00a6e9c98 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 26 Feb 2019 20:11:40 +0100 Subject: [PATCH] Change order for dependencies --- scripts/install | 69 +++++++++++++++++++++++-------------------------- scripts/remove | 2 ++ scripts/upgrade | 9 +------ 3 files changed, 36 insertions(+), 44 deletions(-) diff --git a/scripts/install b/scripts/install index 8e95ab9..7464cdf 100644 --- a/scripts/install +++ b/scripts/install @@ -87,25 +87,19 @@ port=$(ynh_find_port 8095) ynh_app_setting_set $app port $port #================================================= -# INSTALL DEPENDENCIES -#================================================= -ynh_print_info "Installing dependencies..." - -### `ynh_install_app_dependencies` allows you to add any "apt" dependencies to the package. -### Those deb packages will be installed as dependencies of this package. -### If you're not using this helper: -### - Remove the section "REMOVE DEPENDENCIES" in the remove script -### - As well as the section "REINSTALL DEPENDENCIES" in the restore script -### - And the section "UPGRADE DEPENDENCIES" in the upgrade script - -ynh_install_app_dependencies postgresql libstdc++6 redis-server rabbitmq-server - -#================================================= -# INSTALL NODEJS +# ADD NODEJS REPOSITORY #================================================= ynh_print_info "Installing nodejs..." -#curl -sL https://deb.nodesource.com/setup_8.x | sudo bash - +curl -sL https://deb.nodesource.com/setup_8.x | sudo bash - + +#================================================= +# ADD ONLYOFFICE REPOSITORY +#================================================= +ynh_print_info "Add OnlyOffice repository..." + +apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 +echo "deb http://download.onlyoffice.com/repo/debian squeeze main" | sudo tee /etc/apt/sources.list.d/onlyoffice.list #================================================= # CREATE A POSTGRESQL DATABASE @@ -121,6 +115,7 @@ ynh_print_info "Creating a PostgreSQL database..." ### - Remove also the section "REMOVE THE POSTGRESQL DATABASE" in the remove script ### - As well as the section "RESTORE THE POSTGRESQL DATABASE" in the restore script +ynh_package_install postgresql db_name=$(ynh_sanitize_dbid $app) db_pwd="onlyoffice" ynh_app_setting_set $app db_name $db_name @@ -128,6 +123,27 @@ ynh_app_setting_set $app db_pwd $db_pwd ynh_psql_test_if_first_run ynh_psql_create_db $db_name $db_name $db_pwd +#================================================= +# DEFINE PORT +#================================================= +ynh_print_info "Define OnlyOffice server port..." + +echo onlyoffice-documentserver onlyoffice/ds-port select ${port} | sudo debconf-set-selections + +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_print_info "Installing dependencies..." + +### `ynh_install_app_dependencies` allows you to add any "apt" dependencies to the package. +### Those deb packages will be installed as dependencies of this package. +### If you're not using this helper: +### - Remove the section "REMOVE DEPENDENCIES" in the remove script +### - As well as the section "REINSTALL DEPENDENCIES" in the restore script +### - And the section "UPGRADE DEPENDENCIES" in the upgrade script + +ynh_install_app_dependencies postgresql libstdc++6 redis-server rabbitmq-server onlyoffice-documentserver + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -162,27 +178,8 @@ ynh_system_user_create $app $final_path #================================================= # SPECIFIC SETUP #================================================= -# DEFINE PORT +# ... #================================================= -ynh_print_info "Define OnlyOffice server port..." - -echo onlyoffice-documentserver onlyoffice/ds-port select ${port} | sudo debconf-set-selections - -#================================================= -# ADD ONLYOFFICE REPOSITORY -#================================================= -ynh_print_info "Add OnlyOffice repository..." - -apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 -echo "deb http://download.onlyoffice.com/repo/debian squeeze main" | sudo tee /etc/apt/sources.list.d/onlyoffice.list -ynh_package_update - -#================================================= -# INSTALL ONLYOFFICE -#================================================= -ynh_print_info "Install OnlyOffice..." - -ynh_package_install onlyoffice-documentserver #================================================= # MODIFY A CONFIG FILE diff --git a/scripts/remove b/scripts/remove index ee71d4d..17aea17 100644 --- a/scripts/remove +++ b/scripts/remove @@ -80,6 +80,8 @@ fi # Remove a directory securely ynh_secure_remove "/etc/apt/sources.list.d/onlyoffice.list" +ynh_secure_remove "/etc/apt/sources.list.d/onlyoffice.list" +ynh_secure_remove "/etc/apt/sources.list.d/nodesource.list" # Remove the log files ynh_secure_remove "/var/log/$app/" diff --git a/scripts/upgrade b/scripts/upgrade index 383d979..ef272bf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -84,14 +84,7 @@ ynh_add_nginx_config "nextclouddomain" #================================================= ynh_print_info "Upgrading dependencies..." -ynh_install_app_dependencies postgresql libstdc++6 redis-server rabbitmq-server - -#================================================= -# UPGRADE NODEJS -#================================================= -ynh_print_info "Upgrading nodejs..." - -curl -sL https://deb.nodesource.com/setup_8.x | sudo bash - +ynh_install_app_dependencies postgresql libstdc++6 redis-server rabbitmq-server nodejs #================================================= # UPGRADE ONLYOFFICE