From 76ec7b02b661bd0d54460df593be9ff20a03bd1f Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 10 Nov 2021 00:17:02 +0700 Subject: [PATCH] Check if MinIO is installed or not --- manifest.json | 7 +------ scripts/install | 12 ++++++++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/manifest.json b/manifest.json index 1199903..9c28f13 100644 --- a/manifest.json +++ b/manifest.json @@ -58,15 +58,10 @@ "type": "string", "ask": "Slack Client Secret (from https://api.slack.com/apps)" }, - { - "name": "is_minio", - "type": "boolean", - "ask": "Is MinIO app already installed on your instance ?" - }, { "name": "minio_domain", "type": "domain", - "ask": "If MinIO app is already installed, you don't need to fill-in that field.\nIf it isn't please give a domain that can be used for MinIO installation (MinIO has to be installed at the root of a domain)\nIf MinIO is alraedy installed, you can leave this field empty." + "ask": "Is MinIO app already installed ?\nIf yes, you can leave that field blank.\nIf not please give a domain that can be used for MinIO installation.\nPlease note that MinIO has to be installed at the root of that domain : no other apps can be installed on that domain" } ] } diff --git a/scripts/install b/scripts/install index 5366c35..77985e5 100755 --- a/scripts/install +++ b/scripts/install @@ -44,9 +44,17 @@ utils_secret=`openssl rand -hex 32` slack_key=$YNH_APP_ARG_SLACK_KEY slack_secret=$YNH_APP_ARG_SLACK_SECRET - app=$YNH_APP_INSTANCE_NAME +#================================================= +# CHECK IF MINIO IS INSTALLED, IF NOT INSTALL IT +#================================================= +ynh_script_progression --message="Installing MinIO if needed..." --time --weight=1 + +if ! ynh_package_is_installed --package="minio"; then + yunohost tools update + yunohost app install minio --force --args "domain=$YNH_APP_ARG_MINIO_DOMAIN&is_public=true&language=en" + minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id) minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key) @@ -149,7 +157,7 @@ ynh_add_nginx_config #================================================= # BUILD YARN DEPENDENCIES #================================================= -ynh_script_progression --message="Building Yarn dependencies... This can be very long, be patient !" +ynh_script_progression --message="Building Yarn dependencies... This can be very long, be patient !" --time --weight=10 pushd "$final_path" ynh_use_nodejs