diff --git a/check_process b/check_process index 1bb3deb..9f8d2db 100644 --- a/check_process +++ b/check_process @@ -1,7 +1,7 @@ # See here for more information # https://github.com/YunoHost/package_check#syntax-check_process-file -;; Test complet +;; Test with Entreprise Edition ; Manifest domain="domain.tld" (DOMAIN) path="/path" (PATH) @@ -11,6 +11,7 @@ password="admin!42" admin_password="admin!42" language="fr" + version="Entreprise" team_display_name="Mon équipe" is_public=1 (PUBLIC|public=1|private=0) ; Checks @@ -26,6 +27,28 @@ multi_instance=1 port_already_use=0 change_url=0 +;; Test with Team Edition + ; Manifest + domain="domain.tld" (DOMAIN) + path="/path" (PATH) + admin="john" (USER) + email="john@gmail.com" + admin_email="john@gmail.com" + password="admin!42" + admin_password="admin!42" + language="fr" + version="Team" + team_display_name="Mon équipe" + is_public=1 (PUBLIC|public=1|private=0) + ; Checks + setup_sub_dir=1 + setup_root=1 + setup_private=1 + setup_public=1 + upgrade=1 + upgrade=1 from_commit=202cc0725652d4b8fbca52630267247bd58c8de1 + backup_restore=1 + multi_instance=1 ;;; Options Email=kemenaran@gmail.com Notification=none diff --git a/conf/enterprise.src b/conf/enterprise.src new file mode 100644 index 0000000..5226b55 --- /dev/null +++ b/conf/enterprise.src @@ -0,0 +1,6 @@ +SOURCE_URL=https://releases.mattermost.com/5.30.1/mattermost-5.30.1-linux-amd64.tar.gz +SOURCE_SUM=14018addf86c040200515cb0141308a6d213f149f8afe425dd171347be516401 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME=mattermost-5.30.1-linux-amd64.tar.gz diff --git a/manifest.json b/manifest.json index b946125..8aaea8c 100644 --- a/manifest.json +++ b/manifest.json @@ -73,6 +73,20 @@ }, "example": "Choose a password" }, + { + "name": "version", + "type": "string", + "ask": { + "en": "Choose the version you want to install", + "fr": "Choisissez la version que vous souhaitez installer" + }, + "ask": { + "en": "Use Team Edition for the open source version (ARM, ARM64 and x86-64 support) or Entreprise edition if you want to use a license (x86-64 support only)", + "fr": "Utilisez Team Edition pour la version open source (prise en charge ARM, ARM64 et x86-64) ou Entreprise Edition si vous souhaitez utiliser une licence (prise en charge x86-64 uniquement)" + }, + "choices": ["Entreprise", "Team"], + "default": "Team" + }, { "name": "language", "type": "string", diff --git a/scripts/install b/scripts/install index 55b1ee3..9c69481 100644 --- a/scripts/install +++ b/scripts/install @@ -32,6 +32,7 @@ password=$YNH_APP_ARG_PASSWORD language=$YNH_APP_ARG_LANGUAGE team_display_name=$YNH_APP_ARG_TEAM_DISPLAY_NAME architecture=$(ynh_detect_arch) +version=$YNH_APP_ARG_VERSION app=$YNH_APP_INSTANCE_NAME @@ -57,6 +58,7 @@ ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=password --value=$password ynh_app_setting_set --app=$app --key=language --value=$language +ynh_app_setting_set --app=$app --key=version --value=$version ynh_app_setting_set --app=$app --key=team_display_name --value=$team_display_name #================================================= @@ -94,7 +96,14 @@ ynh_script_progression --message="Setting up source files..." --weight=3 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" + +if [ "$version" = "Entreprise" ]; then + # Get Entreprise binary path + ynh_setup_source --dest_dir="$final_path" --source_id="$entreprise" +elif [ "$version" = "Team" ]; then + # Get Team binary path + ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" +fi #================================================= # CREATE DIRECTORY FOR DATA diff --git a/scripts/upgrade b/scripts/upgrade index 371ae6e..94cddd8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -34,6 +34,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) language=$(ynh_app_setting_get --app=$app --key=language) db_name=$(ynh_app_setting_get --app=$app --key=db_name) architecture=$(ynh_detect_arch) +version=$(ynh_app_setting_get --app=$app --key=version) #================================================= # CHECK VERSION @@ -60,6 +61,18 @@ if ! [[ "$port" ]]; then ynh_app_setting_set --app=$app --key=port --value=$port fi +# Save the language used if not present +if ! [[ "$language" ]]; then + language="en" + ynh_app_setting_set --app=$app --key=language --value=$language +fi + +# If version setting doesn't exist +if [ -z "$version" ]; then + version="Team" + ynh_app_setting_set --app=$app --key=version --value=$version +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -100,8 +113,11 @@ then # Remove the app directory securely ynh_secure_remove --file="$final_path" - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" + if [ "$version" = "Entreprise" ]; then + ynh_setup_source --dest_dir="$final_path" --source_id="$entreprise" + elif [ "$version" = "Team" ]; then + ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" + fi # Copy the admin saved settings from tmp directory to final path cp -a "$tmpdir/config.json" "$final_path/config/config.json" @@ -168,7 +184,6 @@ chown -R $app: "$data_path" chown -R $app: $final_path chmod -R g+w $final_path - chown -R $app: "/var/log/$app" #=================================================