From 669c8520a71f6f0a6588be24d717e0d1d158a8e0 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 23 Jul 2021 11:54:20 +0200 Subject: [PATCH] Fix --- manifest.json | 2 +- scripts/install | 6 +++--- scripts/remove | 1 - scripts/upgrade | 31 +++++++++++++++++-------------- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/manifest.json b/manifest.json index e709731..335526f 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "id": "couchdb", "packaging_format": 1, "description": { - "en": "An open-source document-oriented NoSQL database", + "en": "Open-source document-oriented NoSQL database", "fr": "Système de gestion de base de données orienté documents" }, "version": "3.1.1~ynh2", diff --git a/scripts/install b/scripts/install index 143a6c4..d77fe6c 100755 --- a/scripts/install +++ b/scripts/install @@ -35,7 +35,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Validating installation parameters..." --weight=1 -final_path=/opt/couchdb +final_path=/opt/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" # Register (book) web path @@ -82,7 +82,7 @@ ynh_add_nginx_config #================================================= # INSTALL COUCHDB #================================================= -ynh_script_progression --message="Installing couchdb..." --weight=60 +ynh_script_progression --message="Installing CouchDB..." --weight=60 COUCHDB_PASSWORD=$password echo "couchdb couchdb/mode select standalone @@ -102,7 +102,7 @@ ynh_install_extra_app_dependencies --repo="https://apache.jfrog.io/artifactory/c #================================================= # ADD SOME CUSTOM CONFIGURATION TO COUCH #================================================= -ynh_script_progression --message="Customizing couchdb config..." --weight=2 +ynh_script_progression --message="Customizing CouchDB config..." --weight=2 # customize a bit the couch config ynh_add_config --template="../conf/couch_ynh.ini" --destination="$final_path/etc/local.d/couch_ynh.ini" diff --git a/scripts/remove b/scripts/remove index 369c1f1..a488894 100755 --- a/scripts/remove +++ b/scripts/remove @@ -26,7 +26,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) # REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= -# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null then ynh_script_progression --message="Removing $app service integration..." --weight=2 diff --git a/scripts/upgrade b/scripts/upgrade index f379d9d..896dfc3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,7 +25,6 @@ password=$(ynh_app_setting_get --app=$app --key=password) #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) @@ -63,22 +62,26 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # UPGRADING COUCHDB #================================================= -ynh_script_progression --message="Upgrading couchdb..." --weight=60 -COUCHDB_PASSWORD=$password -echo "couchdb couchdb/mode select standalone -couchdb couchdb/mode seen true -couchdb couchdb/bindaddress string 127.0.0.1 -couchdb couchdb/bindaddress seen true -couchdb couchdb/adminpass password ${COUCHDB_PASSWORD} -couchdb couchdb/adminpass seen true -couchdb couchdb/adminpass_again password ${COUCHDB_PASSWORD} -couchdb couchdb/adminpass_again seen true" | debconf-set-selections -DEBIAN_FRONTEND=noninteractive # apt-get install -y --force-yes couchdb +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_script_progression --message="Upgrading CouchDB..." --weight=50 -apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 390EF70BB1EA12B2773962950EE62FB37A00258D 2>/dev/null + COUCHDB_PASSWORD=$password + echo "couchdb couchdb/mode select standalone + couchdb couchdb/mode seen true + couchdb couchdb/bindaddress string 127.0.0.1 + couchdb couchdb/bindaddress seen true + couchdb couchdb/adminpass password ${COUCHDB_PASSWORD} + couchdb couchdb/adminpass seen true + couchdb couchdb/adminpass_again password ${COUCHDB_PASSWORD} + couchdb couchdb/adminpass_again seen true" | debconf-set-selections + DEBIAN_FRONTEND=noninteractive # apt-get install -y --force-yes couchdb -ynh_install_extra_app_dependencies --repo="https://apache.jfrog.io/artifactory/couchdb-deb/ buster main" --package="couchdb" + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 390EF70BB1EA12B2773962950EE62FB37A00258D 2>/dev/null + + ynh_install_extra_app_dependencies --repo="https://apache.jfrog.io/artifactory/couchdb-deb/ buster main" --package="couchdb" +fi #================================================= # UPDATE A CONFIG FILE